/* ==========================================================================
   MJ SERVICES — Admin : styles
   Même identité que la vitrine : noir et blanc, une couleur de signal.
   Thème clair / sombre : suit le système, ou choix manuel (data-theme).
   ========================================================================== */

:root{
  --bg:#0b0b0c;
  --surface:#121214;
  --surface-2:#18181b;
  --line:rgba(255,255,255,0.09);
  --line-strong:rgba(255,255,255,0.16);
  --text:#f2f0eb;
  --muted:#9a9a94;
  --signal:#ff4d2e;
  --signal-soft:rgba(255,77,46,0.14);
  --ok:#3ddc97;
  --ok-soft:rgba(61,220,151,0.14);
  --warn:#f5b042;
  --warn-soft:rgba(245,176,66,0.15);
  --danger:#ff6161;
  --danger-soft:rgba(255,97,97,0.14);
  --info:#6ea8ff;
  --info-soft:rgba(110,168,255,0.14);
  --shadow:0 18px 50px rgba(0,0,0,0.5);
  --radius:12px;
  /* noms hérités par les pages et scripts existants */
  --bg-dark:var(--bg);
  --bg-dark-2:var(--surface-2);
  --text-light:var(--text);
  --text-muted:var(--muted);
  --glass:var(--surface);
  --glass-border:var(--line);
  --accent-1:var(--signal);
  --accent-2:var(--signal);
  --sw:248px;
  color-scheme:dark;
}
:root[data-theme="light"]{
  --bg:#f4f2ed;
  --surface:#ffffff;
  --surface-2:#faf9f6;
  --line:rgba(10,10,10,0.1);
  --line-strong:rgba(10,10,10,0.2);
  --text:#101010;
  --muted:#65655f;
  --signal-soft:rgba(255,77,46,0.1);
  --ok:#0f9d63;
  --ok-soft:rgba(15,157,99,0.12);
  --warn:#b56f00;
  --warn-soft:rgba(181,111,0,0.12);
  --danger:#d33a3a;
  --danger-soft:rgba(211,58,58,0.1);
  --info:#2563eb;
  --info-soft:rgba(37,99,235,0.1);
  --shadow:0 18px 50px rgba(20,20,20,0.16);
  color-scheme:light;
}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]){
    --bg:#f4f2ed;--surface:#ffffff;--surface-2:#faf9f6;
    --line:rgba(10,10,10,0.1);--line-strong:rgba(10,10,10,0.2);
    --text:#101010;--muted:#65655f;--signal-soft:rgba(255,77,46,0.1);
    --ok:#0f9d63;--ok-soft:rgba(15,157,99,0.12);--warn:#b56f00;--warn-soft:rgba(181,111,0,0.12);
    --danger:#d33a3a;--danger-soft:rgba(211,58,58,0.1);--info:#2563eb;--info-soft:rgba(37,99,235,0.1);
    --shadow:0 18px 50px rgba(20,20,20,0.16);
    color-scheme:light;
  }
}

*{box-sizing:border-box;margin:0;padding:0;}
html{-webkit-text-size-adjust:100%;}
body{font-family:'Inter',system-ui,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;
  font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;}
h1,h2,h3{font-family:'Inter Tight','Inter',sans-serif;letter-spacing:-0.02em;}
a{color:inherit;}
button{font-family:inherit;}
:focus-visible{outline:2px solid var(--signal);outline-offset:2px;border-radius:6px;}
[hidden]{display:none!important;}
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;}
body.pending{visibility:hidden;}

/* ───────────── boutons ───────────── */
.abtn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 16px;border-radius:10px;
  border:1px solid transparent;cursor:pointer;font-weight:600;font-size:13.5px;line-height:1.2;
  background:var(--signal);color:#160804;transition:transform .15s,background .2s,border-color .2s,opacity .2s;white-space:nowrap;}
.abtn:hover{transform:translateY(-1px);}
.abtn:disabled{opacity:.55;cursor:default;transform:none;}
.abtn-bloc{width:100%;}
.abtn-discret{background:transparent;border-color:var(--line-strong);color:var(--text);}
.abtn-discret:hover{background:var(--surface-2);}
.abtn-danger{background:var(--danger-soft);color:var(--danger);border-color:transparent;}
.abtn-petit{padding:6px 11px;font-size:12.5px;border-radius:8px;}
.abtn svg,.aicone{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.abtn-icone{padding:8px;width:36px;height:36px;}

/* ───────────── champs ───────────── */
.achamp{margin-bottom:16px;}
.achamp label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:6px;font-weight:500;}
.achamp input,.achamp textarea,.achamp select,.achamp-ligne input,.afiltres select,.arecherche input,
.atable select,.atextarea{
  width:100%;padding:9px 12px;border-radius:10px;border:1px solid var(--line-strong);background:var(--surface);
  color:var(--text);font-family:inherit;font-size:14px;transition:border-color .2s,box-shadow .2s;}
.achamp input:focus,.achamp textarea:focus,.achamp select:focus,.arecherche input:focus,.atextarea:focus,.afiltres select:focus{
  outline:none;border-color:var(--signal);box-shadow:0 0 0 3px var(--signal-soft);}
.achamp textarea{min-height:150px;resize:vertical;line-height:1.5;}
.atextarea{min-height:110px;resize:vertical;line-height:1.5;}
.agrille-2{display:grid;grid-template-columns:1fr 1fr;gap:0 14px;}
@media (max-width:560px){.agrille-2{grid-template-columns:1fr;}}

/* ───────────── cartes ───────────── */
.acard{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;}
.acard h2,.acard h3{font-size:15px;font-weight:700;}
.acard-tete{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;}
.acard-tete a,.alien-discret{color:var(--muted);font-size:12.5px;text-decoration:none;}
.acard-tete a:hover,.alien-discret:hover{color:var(--signal);}
.asous{color:var(--muted);font-size:14px;margin-bottom:20px;}

/* ───────────── alertes (inline, page de connexion) ───────────── */
.aalert{padding:10px 14px;border-radius:10px;font-size:13px;margin-bottom:12px;}
.aalert-erreur{background:var(--danger-soft);color:var(--danger);}
.aalert-succes{background:var(--ok-soft);color:var(--ok);}
.aalert-info{background:var(--info-soft);color:var(--info);}

/* ───────────── connexion ───────────── */
.aconnexion{min-height:100vh;display:grid;place-items:center;padding:24px 16px;position:relative;overflow:hidden;}
.aconnexion::before{content:'';position:absolute;right:-160px;top:-180px;width:560px;height:560px;border-radius:50%;
  background:radial-gradient(circle,var(--signal-soft),transparent 66%);pointer-events:none;}
.aconnexion-cadre{position:relative;width:100%;max-width:400px;}
.aconnexion-marque{display:flex;align-items:center;gap:10px;margin-bottom:22px;font-family:'Inter Tight',sans-serif;font-weight:800;font-size:18px;}
.aconnexion-marque img{height:30px;filter:var(--logo-filtre,none);}
:root[data-theme="light"] .aconnexion-marque img{--logo-filtre:invert(1);}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .aconnexion-marque img{filter:invert(1);}}
.aconnexion .acard{padding:30px 28px;}
.aconnexion h1{font-size:24px;margin-bottom:6px;}

/* ───────────── structure : menu + contenu ───────────── */
.ashell{display:grid;grid-template-columns:var(--sw) 1fr;min-height:100vh;transition:grid-template-columns .25s;}
html.menu-replie{--sw:72px;}
.asidebar{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;border-right:1px solid var(--line);
  background:var(--surface);padding:16px 12px;z-index:40;overflow:hidden;}
.amarque{display:flex;align-items:center;gap:10px;padding:4px 8px 18px;text-decoration:none;min-height:50px;}
.amarque img{height:26px;width:auto;flex:none;}
:root[data-theme="light"] .amarque img{filter:invert(1);}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .amarque img{filter:invert(1);}}
.amarque span{font-family:'Inter Tight',sans-serif;font-weight:800;font-size:15px;letter-spacing:.02em;white-space:nowrap;}
.amarque small{display:block;font-family:'JetBrains Mono',monospace;font-size:10px;color:var(--muted);letter-spacing:.14em;font-weight:500;margin-top:1px;}
.anav-titre{font-family:'JetBrains Mono',monospace;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);
  padding:14px 12px 6px;white-space:nowrap;}
.anav{display:flex;flex-direction:column;gap:2px;}
.anav-lien{position:relative;display:flex;align-items:center;gap:12px;padding:9px 12px;border-radius:10px;color:var(--muted);
  text-decoration:none;font-size:13.5px;font-weight:600;white-space:nowrap;transition:background .15s,color .15s;}
.anav-lien:hover{background:var(--surface-2);color:var(--text);}
.anav-lien.actif{background:var(--surface-2);color:var(--text);}
.anav-lien.actif::before{content:'';position:absolute;left:-12px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--signal);}
.anav-lien svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.anav-lien .abulle{margin-left:auto;}
.abulle{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--signal);color:#160804;font-size:11.5px;font-weight:700;
  display:inline-grid;place-items:center;font-variant-numeric:tabular-nums;}
.abulle:empty,.abulle[data-n="0"]{display:none;}
.asidebar-bas{margin-top:auto;display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--line);}
.autilisateur{display:flex;align-items:center;gap:10px;padding:8px;border-radius:10px;min-width:0;}
.aavatar{width:34px;height:34px;border-radius:50%;background:var(--signal);color:#160804;display:grid;place-items:center;
  font-weight:800;font-size:14px;flex:none;}
.autilisateur-txt{min-width:0;line-height:1.3;}
.autilisateur-txt b{display:block;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.autilisateur-txt small{color:var(--muted);font-size:11.5px;}
html.menu-replie .amarque span,html.menu-replie .anav-titre,html.menu-replie .anav-lien span:not(.abulle),
html.menu-replie .autilisateur-txt,html.menu-replie .asidebar-bas .abtn span{display:none;}
html.menu-replie .anav-lien{justify-content:center;padding:10px;}
html.menu-replie .anav-lien .abulle{position:absolute;top:2px;right:4px;min-width:16px;height:16px;font-size:10px;padding:0 4px;}
html.menu-replie .asidebar-bas .abtn{padding:9px;}

.acorps{min-width:0;display:flex;flex-direction:column;}
.atopbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:10px;padding:12px 24px;
  background:color-mix(in srgb,var(--bg) 86%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);}
.afil{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);min-width:0;}
.afil b{color:var(--text);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.atopbar-fin{margin-left:auto;display:flex;align-items:center;gap:8px;}
.arechercher{display:flex;align-items:center;gap:10px;min-width:230px;padding:7px 12px;border-radius:10px;border:1px solid var(--line-strong);
  background:var(--surface);color:var(--muted);font-size:13px;cursor:pointer;}
.arechercher:hover{border-color:var(--muted);}
.arechercher kbd{margin-left:auto;font-family:'JetBrains Mono',monospace;font-size:11px;padding:2px 6px;border-radius:5px;
  border:1px solid var(--line-strong);color:var(--muted);}
.acloche{position:relative;}
.acloche .abulle{position:absolute;top:-4px;right:-4px;min-width:17px;height:17px;font-size:10.5px;padding:0 4px;}
.acontenu{padding:26px 24px 60px;width:100%;max-width:1320px;margin:0 auto;flex:1;}
.apage-tete{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px;}
.apage-tete h1{font-size:26px;font-weight:800;}
.apage-tete p{color:var(--muted);margin-top:4px;font-size:13.5px;}
.aactions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.amenu-burger{display:none;}

/* menu déroulant (notifications, thème…) */
.apop{position:absolute;right:0;top:calc(100% + 8px);width:320px;background:var(--surface);border:1px solid var(--line-strong);
  border-radius:var(--radius);box-shadow:var(--shadow);padding:6px;z-index:60;}
.apop h3{font-size:12px;font-family:'JetBrains Mono',monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding:10px 10px 6px;font-weight:500;}
.apop a,.apop button.apop-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border-radius:8px;border:0;background:none;color:var(--text);
  text-decoration:none;font-size:13.5px;cursor:pointer;text-align:left;}
.apop a:hover,.apop button.apop-item:hover{background:var(--surface-2);}
.apop .apop-vide{padding:14px 10px;color:var(--muted);font-size:13px;}

/* mobile : le menu devient un tiroir */
@media (max-width:900px){
  .ashell{grid-template-columns:1fr;}
  .asidebar{position:fixed;inset:0 auto 0 0;width:270px;transform:translateX(-102%);transition:transform .25s;box-shadow:var(--shadow);}
  html.menu-ouvert .asidebar{transform:none;}
  html.menu-ouvert body::after{content:'';position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:35;}
  html.menu-replie{--sw:248px;}
  html.menu-replie .amarque span,html.menu-replie .anav-titre,html.menu-replie .anav-lien span:not(.abulle),
  html.menu-replie .autilisateur-txt,html.menu-replie .asidebar-bas .abtn span{display:revert;}
  html.menu-replie .anav-lien{justify-content:flex-start;padding:9px 12px;}
  .amenu-burger{display:inline-grid;}
  .arechercher{min-width:0;}
  .arechercher span,.arechercher kbd{display:none;}
  .atopbar{padding:10px 14px;}
  .acontenu{padding:20px 14px 60px;}
  .apop{position:fixed;left:12px;right:12px;top:60px;width:auto;}
}

/* ───────────── indicateurs ───────────── */
.akpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin-bottom:18px;}
.akpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;display:flex;flex-direction:column;gap:8px;text-decoration:none;color:inherit;
  transition:border-color .2s,transform .2s;}
a.akpi:hover{border-color:var(--line-strong);transform:translateY(-2px);}
.akpi-lib{display:flex;align-items:center;justify-content:space-between;font-size:12.5px;color:var(--muted);font-weight:500;}
.akpi-lib svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.akpi-val{font-family:'Inter Tight',sans-serif;font-size:32px;font-weight:800;line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;}
.akpi-pied{font-size:12px;color:var(--muted);min-height:18px;}
.adelta{display:inline-flex;align-items:center;gap:4px;font-weight:600;padding:1px 7px;border-radius:999px;font-size:11.5px;}
.adelta-hausse{background:var(--ok-soft);color:var(--ok);}
.adelta-baisse{background:var(--danger-soft);color:var(--danger);}
.adelta-stable{background:var(--surface-2);color:var(--muted);}
.asquelette{display:block;border-radius:6px;background:linear-gradient(90deg,var(--surface-2),var(--line),var(--surface-2));background-size:200% 100%;
  animation:aseche 1.4s linear infinite;color:transparent!important;}
@keyframes aseche{to{background-position:-200% 0;}}
.agrille-tb{display:grid;grid-template-columns:2fr 1fr;gap:14px;margin-bottom:14px;}
.agrille-tb-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px;}
@media (max-width:1100px){.agrille-tb,.agrille-tb-3{grid-template-columns:1fr 1fr;}}
@media (max-width:760px){.agrille-tb,.agrille-tb-3{grid-template-columns:1fr;}}
.aliste-simple{display:flex;flex-direction:column;}
.aligne{display:flex;align-items:center;gap:12px;padding:10px 4px;border-top:1px solid var(--line);text-decoration:none;color:inherit;min-width:0;}
.aligne:first-child{border-top:0;}
a.aligne:hover{background:var(--surface-2);}
.aligne-txt{flex:1;min-width:0;}
.aligne-txt b{display:block;font-size:13.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.aligne-txt small{display:block;color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.aligne-date{color:var(--muted);font-size:12px;white-space:nowrap;}
.apastille{width:8px;height:8px;border-radius:50%;background:var(--signal);flex:none;}
.avide{color:var(--muted);text-align:center;padding:34px 20px;font-size:13.5px;}
.avide b{display:block;color:var(--text);font-size:14.5px;margin-bottom:4px;}

.agraphe{width:100%;height:190px;display:block;}
.agraphe .barre{fill:var(--signal);opacity:.85;transition:opacity .15s;}
.agraphe .barre:hover{opacity:1;}
.agraphe .axe{stroke:var(--line);stroke-width:1;}
.agraphe text{fill:var(--muted);font-size:10.5px;font-family:'JetBrains Mono',monospace;}
.aaccueil-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;}
.araccourci{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:10px;border:1px solid var(--line);background:var(--surface);
  color:var(--text);text-decoration:none;font-weight:600;font-size:13.5px;cursor:pointer;text-align:left;}
.araccourci:hover{border-color:var(--signal);}
.araccourci svg{width:18px;height:18px;stroke:var(--signal);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;}

/* ───────────── barre d'outils des listes ───────────── */
.abarre{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:14px;}
.arecherche{position:relative;flex:1;min-width:200px;max-width:380px;}
.arecherche svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);width:16px;height:16px;stroke:var(--muted);fill:none;stroke-width:1.8;stroke-linecap:round;pointer-events:none;}
.arecherche input{padding-left:34px;}
.afiltres{display:flex;gap:8px;flex-wrap:wrap;}
.afiltres select{width:auto;}
.apuces{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px;}
.apuce{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:999px;border:1px solid var(--line-strong);background:transparent;
  color:var(--muted);font-size:13px;font-weight:600;cursor:pointer;transition:all .15s;}
.apuce:hover{color:var(--text);}
.apuce.actif{background:var(--text);color:var(--bg);border-color:var(--text);}
.apuce em{font-style:normal;font-size:11.5px;opacity:.75;font-variant-numeric:tabular-nums;}

/* ───────────── tableaux ───────────── */
.atable-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);}
.atable{width:100%;border-collapse:collapse;font-size:13.5px;min-width:760px;}
.atable th{text-align:left;padding:11px 14px;color:var(--muted);font-weight:600;font-size:12px;text-transform:none;border-bottom:1px solid var(--line);
  white-space:nowrap;background:var(--surface-2);}
.atable th.tri{cursor:pointer;user-select:none;}
.atable th.tri:hover{color:var(--text);}
.atable td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle;}
.atable tr:last-child td{border-bottom:none;}
.atable tbody tr{cursor:pointer;transition:background .12s;}
.atable tbody tr:hover td{background:var(--surface-2);}
.atable tbody tr.choisi td{background:var(--signal-soft);}
.atable .acol-coche{width:38px;padding-right:0;}
.atable input[type=checkbox]{width:16px;height:16px;accent-color:var(--signal);cursor:pointer;}
.atable .acol-sec{color:var(--muted);}
.acontact b{display:block;font-weight:600;}
.acontact small{color:var(--muted);font-size:12px;}
.abadge{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap;}
.abadge::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;}
.abadge-nouveau{background:var(--signal-soft);color:var(--signal);}
.abadge-contacte{background:var(--info-soft);color:var(--info);}
.abadge-gagne{background:var(--ok-soft);color:var(--ok);}
.abadge-perdu{background:var(--danger-soft);color:var(--danger);}
.abadge-neutre{background:var(--surface-2);color:var(--muted);}
.abadge-neutre::before{display:none;}
.apagination{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:12px;color:var(--muted);font-size:13px;}
.apagination .aactions{gap:6px;}
.alotbar{position:sticky;bottom:14px;z-index:20;display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px;padding:10px 14px;
  background:var(--text);color:var(--bg);border-radius:12px;box-shadow:var(--shadow);}
.alotbar .abtn{background:rgba(127,127,127,.2);color:var(--bg);border:0;}
.alotbar .abtn:hover{background:rgba(127,127,127,.34);}
.alotbar b{margin-right:auto;font-size:13.5px;}

/* ───────────── volet latéral (détail) ───────────── */
.avolet-fond{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:70;opacity:0;pointer-events:none;transition:opacity .2s;}
.avolet-fond.ouvert{opacity:1;pointer-events:auto;}
.avolet{position:fixed;top:0;right:0;bottom:0;width:min(460px,100%);background:var(--surface);border-left:1px solid var(--line-strong);z-index:71;
  transform:translateX(102%);transition:transform .28s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column;box-shadow:var(--shadow);}
.avolet.ouvert{transform:none;}
.avolet-tete{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 20px;border-bottom:1px solid var(--line);}
.avolet-tete h2{font-size:17px;}
.avolet-corps{flex:1;overflow-y:auto;padding:20px;}
.avolet-pied{padding:14px 20px;border-top:1px solid var(--line);display:flex;gap:8px;justify-content:space-between;align-items:center;flex-wrap:wrap;}
.adetail{display:grid;grid-template-columns:110px 1fr;gap:10px 12px;font-size:13.5px;margin-bottom:20px;}
.adetail dt{color:var(--muted);}
.adetail dd{min-width:0;word-break:break-word;}
.aenreg{font-size:12px;color:var(--muted);}

/* ───────────── messagerie ───────────── */
.aonglets{display:flex;gap:4px;padding:3px;background:var(--surface-2);border:1px solid var(--line);border-radius:11px;}
.aonglets button{display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:8px;border:0;background:none;color:var(--muted);font-size:13px;font-weight:600;cursor:pointer;}
.aonglets button.actif{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.2);}
.aboite{display:grid;grid-template-columns:360px 1fr;gap:14px;align-items:start;}
.aliste{border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;max-height:calc(100vh - 250px);min-height:300px;overflow-y:auto;background:var(--surface);}
.amsg{display:block;width:100%;text-align:left;padding:13px 16px;border:none;border-bottom:1px solid var(--line);background:none;color:inherit;cursor:pointer;position:relative;}
.amsg:hover{background:var(--surface-2);}
.amsg.actif{background:var(--signal-soft);}
.amsg.non-lu::before{content:'';position:absolute;left:6px;top:50%;width:6px;height:6px;margin-top:-3px;border-radius:50%;background:var(--signal);}
.amsg.non-lu .amsg-sujet{font-weight:700;}
.amsg-de{font-size:12.5px;color:var(--muted);display:flex;justify-content:space-between;gap:8px;}
.amsg-de span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.amsg-sujet{font-size:13.5px;margin-top:3px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.alecteur{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);padding:22px;min-height:300px;}
.alecteur-vide{color:var(--muted);text-align:center;padding:70px 20px;}
.alecteur-entete{border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:16px;}
.alecteur-entete h2{font-size:19px;margin-bottom:6px;}
.alecteur-corps{line-height:1.65;font-size:14px;word-break:break-word;overflow-x:auto;}
.alecteur-corps a{color:var(--signal);}
.alecteur-corps img{max-width:100%;height:auto;}
.apieces{margin-top:16px;font-size:12px;color:var(--muted);}
.aretour{display:none;}
@media (max-width:900px){
  .aboite{grid-template-columns:1fr;}
  .aboite.lecture .aliste{display:none;}
  .aboite:not(.lecture) .alecteur{display:none;}
  .aretour{display:inline-flex;}
  .aliste{max-height:none;}
}

/* ───────────── statistiques ───────────── */
.astat-ligne{display:flex;align-items:center;gap:10px;font-size:13px;padding:6px 0;}
.astat-nom{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.astat-barre-fond{flex:1;max-width:110px;height:6px;border-radius:999px;background:var(--line);overflow:hidden;}
.astat-barre{display:block;height:100%;background:var(--signal);}
.astat-nb{width:38px;text-align:right;color:var(--muted);font-variant-numeric:tabular-nums;}

/* ───────────── fenêtres modales ───────────── */
.amodale-fond{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:flex-start;justify-content:center;padding:70px 16px 24px;z-index:80;overflow-y:auto;}
.amodale{background:var(--surface);border:1px solid var(--line-strong);border-radius:16px;padding:24px;max-width:560px;width:100%;box-shadow:var(--shadow);}
.amodale h2{font-size:19px;margin-bottom:16px;}

/* ───────────── notifications ───────────── */
.atoasts{position:fixed;right:16px;bottom:16px;z-index:100;display:flex;flex-direction:column;gap:8px;max-width:min(380px,calc(100vw - 32px));}
.atoast{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:12px;background:var(--text);color:var(--bg);box-shadow:var(--shadow);
  font-size:13.5px;animation:atoast .25s cubic-bezier(.2,.8,.2,1);}
.atoast b{font-weight:700;}
.atoast.erreur{background:var(--danger);color:#fff;}
.atoast.succes{background:var(--ok);color:#06150e;}
.atoast-texte{flex:1;min-width:0;}
.atoast-x{flex:none;margin:-4px -6px 0 0;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:inherit;font-size:20px;line-height:1;cursor:pointer;opacity:.6;}
.atoast-x:hover{opacity:1;background:rgba(127,127,127,.2);}
.atoasts-tout{align-self:flex-end;padding:6px 12px;border:0;border-radius:999px;background:var(--text);color:var(--bg);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;opacity:.85;}
@keyframes atoast{from{opacity:0;transform:translateY(12px);}}

/* ───────────── recherche rapide ───────────── */
.apalette-fond{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:90;display:flex;align-items:flex-start;justify-content:center;padding:12vh 16px 0;}
.apalette{width:100%;max-width:560px;background:var(--surface);border:1px solid var(--line-strong);border-radius:16px;box-shadow:var(--shadow);overflow:hidden;}
.apalette input{width:100%;padding:16px 18px;background:none;border:0;border-bottom:1px solid var(--line);color:var(--text);font-size:15px;font-family:inherit;}
.apalette input:focus{outline:none;}
.apalette-liste{max-height:340px;overflow-y:auto;padding:6px;}
.apalette-groupe{font-family:'JetBrains Mono',monospace;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);padding:10px 12px 4px;}
.apalette-item{display:flex;align-items:center;gap:12px;width:100%;padding:10px 12px;border-radius:9px;border:0;background:none;color:var(--text);cursor:pointer;font-size:14px;text-align:left;}
.apalette-item svg{width:17px;height:17px;stroke:var(--muted);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;}
.apalette-item.actif{background:var(--surface-2);}
.apalette-item kbd{margin-left:auto;font-family:'JetBrains Mono',monospace;font-size:11px;color:var(--muted);}
.apalette-pied{display:flex;gap:16px;padding:9px 14px;border-top:1px solid var(--line);color:var(--muted);font-size:11.5px;}
kbd{font-family:'JetBrains Mono',monospace;font-size:11.5px;padding:2px 6px;border-radius:5px;border:1px solid var(--line-strong);background:var(--surface-2);}
.araccourcis-liste{display:grid;grid-template-columns:1fr auto;gap:8px 20px;font-size:13.5px;}

/* préférences */
.achoix{display:flex;gap:8px;flex-wrap:wrap;}
.achoix button{padding:8px 14px;border-radius:10px;border:1px solid var(--line-strong);background:transparent;color:var(--muted);font-weight:600;font-size:13px;cursor:pointer;}
.achoix button.actif{background:var(--text);color:var(--bg);border-color:var(--text);}
.asection{margin-bottom:14px;}
.asection .acard{max-width:640px;}

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

/* ───────────── panel clients ───────────── */
.afacette{display:flex;align-items:flex-start;gap:12px;margin-bottom:10px;flex-wrap:wrap;}
.afacette-titre{font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding-top:8px;min-width:128px;}
.afacette .apuces{margin-bottom:0;flex:1;}
.apastille-site{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:7px;flex:none;vertical-align:1px;}
.apuce-ajout{border-style:dashed;}
.aoptions{display:flex;gap:2px;padding:2px;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;}
.aoptions button{padding:4px 11px;border-radius:999px;border:0;background:none;color:var(--muted);font-size:12px;font-weight:600;cursor:pointer;}
.aoptions button.actif{background:var(--text);color:var(--bg);}
.atags{display:flex;flex-wrap:wrap;gap:5px;}
.asite-tag,.ainteret-tag{display:inline-flex;align-items:center;gap:0;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap;}
.asite-tag{background:var(--surface-2);border:1px solid var(--line);color:var(--text);}
.ainteret-tag{background:var(--signal-soft);color:var(--text);font-weight:500;}
.apuce-x{border:0;background:none;color:var(--muted);cursor:pointer;font-size:15px;line-height:1;margin-left:6px;padding:0;}
.apuce-x:hover{color:var(--danger);}
.asous-titre{font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:500;margin:22px 0 10px;}
.acomptes{display:flex;flex-direction:column;gap:10px;}
.acompte{border:1px solid var(--line);border-left:3px solid var(--c,var(--signal));border-radius:10px;padding:12px 14px;background:var(--surface-2);}
.acompte-tete{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.acompte-meta{color:var(--muted);font-size:12.5px;margin-top:3px;}
.acompte-interets{margin-top:10px;display:flex;flex-direction:column;gap:6px;}
.acompte-interets > span{font-size:11.5px;color:var(--muted);}
@media (max-width:760px){
  .afacette{gap:6px;}
  .afacette-titre{min-width:0;width:100%;padding-top:0;}
}

/* ── composeur d'e-mail ── */
.acomposeur{max-width:820px;}
.acomp-tete{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:6px;}
.acomp-tete h2{margin-bottom:6px;}
.acomp-options{display:flex;align-items:center;gap:14px;flex-wrap:wrap;font-size:13px;color:var(--muted);}
.acomp-opt{display:inline-flex;align-items:center;gap:6px;}
.acomp-opt select{width:auto;padding:6px 10px;}
.acomp-barre{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);}
.acomp-barre button,.acomp-barre select{width:auto;min-width:34px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);font:inherit;font-size:13px;cursor:pointer;}
.acomp-barre button:hover{border-color:var(--signal);}
.acomp-lien{display:flex;gap:8px;margin-bottom:6px;}
.acomp-editeur{min-height:220px;max-height:46vh;overflow:auto;padding:12px 14px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);color:var(--text);line-height:1.6;outline:none;}
.acomp-editeur:focus{border-color:var(--signal);}
.acomp-editeur h2{font-size:18px;margin:12px 0 6px;}
.acomp-editeur blockquote{margin:8px 0;padding-left:12px;border-left:3px solid var(--line-strong);color:var(--muted);}
.acomp-editeur ul,.acomp-editeur ol{margin:8px 0 8px 22px;}
.acomp-editeur a{color:var(--signal);}
.acomp-pieces{display:flex;flex-direction:column;gap:6px;margin-top:8px;}
.acomp-piece{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;font-size:13px;}
.acomp-piece button{border:0;background:none;color:var(--muted);cursor:pointer;font-size:18px;line-height:1;}
.alabel-simple{display:block;font-size:12.5px;color:var(--muted);margin:8px 0 6px;}

/* ==========================================================================
   Passe design — hiérarchie, rythme et lisibilité
   Principes : une largeur de lecture maîtrisée, un seul accent (la couleur de marque),
   des cartes sobres, des chiffres qui dominent, des libellés discrets.
   ========================================================================== */
:root{--radius:14px;}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;}
#contenu{max-width:1180px;margin-inline:auto;}

/* En-tête de page : titre net, sous-titre court, filet de séparation */
.apage-tete{padding-bottom:20px;margin-bottom:24px;border-bottom:1px solid var(--line);}
.apage-tete h1{font-size:28px;font-weight:700;letter-spacing:-.025em;line-height:1.15;}
.apage-tete p{font-size:14px;line-height:1.5;max-width:64ch;}

/* Indicateurs : le chiffre domine, le libellé s'efface */
.akpis{gap:16px;margin-bottom:20px;}
.akpi{padding:18px 20px;gap:12px;border-radius:var(--radius);transition:border-color .15s,background .15s;}
a.akpi:hover{border-color:var(--line-strong);background:var(--surface-2);}
.akpi-lib{font-size:12.5px;font-weight:500;}
.akpi-val{font-size:34px;font-weight:700;letter-spacing:-.035em;}
.akpi-pied{font-size:12.5px;line-height:1.4;}
/* 5 indicateurs : 3 + 2 qui remplissent la largeur, sans case vide */
@media (min-width:1000px){
  .akpis:has(> :nth-child(5):last-child){grid-template-columns:repeat(6,1fr);}
  .akpis:has(> :nth-child(5):last-child) > :nth-child(-n+3){grid-column:span 2;}
  .akpis:has(> :nth-child(5):last-child) > :nth-child(n+4){grid-column:span 3;}
}

/* 4 indicateurs : une seule rangée */
@media (min-width:1000px){
  .akpis:has(> :nth-child(4):last-child){grid-template-columns:repeat(4,1fr);}
}

/* Cartes */
.acard{padding:22px;border-radius:var(--radius);}
.acard-tete{margin-bottom:16px;}
.acard-tete h2{font-size:14px;font-weight:600;letter-spacing:.005em;}
.acard-tete a{font-weight:500;}

/* Graphiques : barres discrètes, la plus récente ressort */
.agraphe .barre{fill:var(--text);opacity:.2;}
.agraphe .barre:last-of-type{fill:var(--signal);opacity:1;}
.agraphe .barre:hover{opacity:.55;}
.agraphe .barre:last-of-type:hover{opacity:.85;}
.agraphe .axe{stroke:var(--line-strong);}

/* Listes et tableaux */
.aligne{padding:12px 6px;}
.atable thead th{font-size:11px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);}
.atable tbody tr{transition:background .12s;}
.abadge{font-size:11.5px;letter-spacing:.01em;}

/* Boutons et champs : hauteur et rayon cohérents */
.abtn{padding:10px 16px;border-radius:10px;font-weight:600;font-size:13.5px;}
.abtn-petit{padding:7px 12px;}
input[type=text],input[type=email],input[type=url],input[type=search],input[type=password],select,textarea{border-radius:10px;}
:focus-visible{outline:2px solid var(--signal);outline-offset:2px;}

@media (max-width:700px){
  .apage-tete h1{font-size:24px;}
  .akpi-val{font-size:30px;}
  .acard{padding:18px;}
}

/* Sobriété : la couleur de marque reste réservée aux actions et à l'élément actif ;
   le reste de l'interface s'appuie sur le contraste du texte et des filets. */
.akpi-val{color:var(--text);}
.aligne-date,.astat-nb{font-variant-numeric:tabular-nums;}
.acard-tete a:hover,.alien-discret:hover{color:var(--text);text-decoration:underline;text-underline-offset:3px;}

/* ==========================================================================
   Messagerie (webmail) — trois volets : boîtes et dossiers · liste · lecture
   ========================================================================== */
body[data-page="boite"] #contenu{max-width:none;}
.cr-entete{margin-bottom:14px;padding-bottom:12px;}
.cr-prefs{display:flex;gap:18px;align-items:center;flex-wrap:wrap;margin:-4px 0 14px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:13px;color:var(--muted);}
.cr-prefs label{display:flex;align-items:center;gap:8px;}
.cr-prefs select{width:auto;padding:6px 10px;}
.cr-prefs-aide{margin-left:auto;}
.cr-prefs kbd,.cr-vide kbd{font:12px 'JetBrains Mono',monospace;border:1px solid var(--line-strong);border-radius:5px;padding:1px 6px;background:var(--surface-2);}

.cr{display:grid;grid-template-columns:232px minmax(300px,400px) minmax(0,1fr);height:calc(100vh - 178px);min-height:520px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--surface);}
.cr > *{min-width:0;min-height:0;}

/* Colonne : écrire, boîtes, dossiers */
.cr-colonne{display:flex;flex-direction:column;gap:14px;padding:14px;border-right:1px solid var(--line);overflow:auto;background:var(--surface);}
.cr-ecrire{width:100%;justify-content:center;}
.cr-boites{display:flex;flex-direction:column;gap:2px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);}
.cr-boites button{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border:0;border-radius:9px;background:transparent;color:var(--muted);font:inherit;font-size:13px;font-weight:500;cursor:pointer;text-align:left;}
.cr-boites button:hover{color:var(--text);}
.cr-boites button.actif{background:var(--surface);color:var(--text);box-shadow:0 0 0 1px var(--line-strong);font-weight:600;}
.cr-dossiers{display:flex;flex-direction:column;gap:1px;}
.cr-dossier{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;border-radius:9px;background:transparent;color:var(--text);font:inherit;font-size:13.5px;cursor:pointer;text-align:left;position:relative;}
.cr-dossier:hover{background:var(--surface-2);}
.cr-dossier.actif{background:var(--surface-2);font-weight:600;}
.cr-dossier.actif::before{content:'';position:absolute;left:-14px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--signal);}
.cr-dossier-ico{width:18px;text-align:center;font-size:14px;filter:grayscale(.3);}
.cr-dossier-nom{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* Liste */
.cr-liste{display:flex;flex-direction:column;border-right:1px solid var(--line);background:var(--surface);}
.cr-barre{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line);}
.cr-barre .arecherche{width:100%;}
.cr-filtres{display:flex;gap:6px;flex-wrap:wrap;}
.cr-lot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 14px;border-bottom:1px solid var(--line);background:var(--surface-2);font-size:13px;}
.cr-lot b{margin-right:4px;}
.cr-compte{padding:6px 16px;font-size:12px;color:var(--muted);min-height:26px;}
.cr-messages{flex:1;overflow:auto;}
.cr-ligne{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:start;gap:8px;padding:11px 14px;border-bottom:1px solid var(--line);cursor:pointer;position:relative;}
.cr-ligne:hover{background:var(--surface-2);}
.cr-ligne.actif{background:var(--surface-2);box-shadow:inset 3px 0 0 var(--signal);}
.cr-ligne.choisi{background:color-mix(in srgb,var(--signal) 8%,var(--surface));}
.cr-coche{margin-top:3px;width:16px;height:16px;accent-color:var(--signal);cursor:pointer;}
.cr-etoile{border:0;background:none;padding:0 2px;font-size:17px;line-height:1.2;color:var(--muted);cursor:pointer;}
.cr-etoile:hover{color:var(--text);} .cr-etoile.on{color:#f5b301;}
.cr-ligne-texte{min-width:0;}
.cr-ligne-haut{display:flex;align-items:baseline;justify-content:space-between;gap:10px;}
.cr-de{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text);}
.cr-nb{display:inline-block;margin-left:4px;padding:0 6px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);font-size:11px;color:var(--muted);}
.cr-date{flex:none;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;}
.cr-sujet{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:var(--muted);}
.cr-ligne.non-lu .cr-de,.cr-ligne.non-lu .cr-sujet{color:var(--text);font-weight:600;}
.cr-ligne.non-lu::before{content:'';position:absolute;left:5px;top:20px;width:6px;height:6px;border-radius:50%;background:var(--signal);}
.cr-plus{padding:14px;text-align:center;}
.cr[data-densite="compact"] .cr-ligne{padding:7px 14px;}
.cr[data-densite="compact"] .cr-sujet{margin-top:0;}

/* Chargement */
.cr-squelettes{padding:6px 0;}
.cr-squelette{padding:14px;border-bottom:1px solid var(--line);}
.cr-squelette span{display:block;height:11px;border-radius:6px;background:linear-gradient(90deg,var(--surface-2),var(--line),var(--surface-2));background-size:200% 100%;animation:cr-lueur 1.3s infinite linear;}
.cr-squelette span:first-child{width:46%;margin-bottom:10px;} .cr-squelette span:last-child{width:78%;}
@keyframes cr-lueur{from{background-position:200% 0;}to{background-position:-200% 0;}}
.cr-rotation{width:26px;height:26px;margin:0 auto 12px;border:3px solid var(--line-strong);border-top-color:var(--signal);border-radius:50%;animation:cr-tour .8s linear infinite;}
@keyframes cr-tour{to{transform:rotate(360deg);}}
@media (prefers-reduced-motion:reduce){.cr-squelette span,.cr-rotation{animation:none;}}

/* Lecture */
.cr-lecteur{overflow:auto;background:var(--surface);}
.cr-vide{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;min-height:260px;padding:30px;text-align:center;color:var(--muted);}
.cr-vide b{color:var(--text);font-size:15px;} .cr-vide p{max-width:36ch;font-size:13.5px;}
.cr-vide-ico{font-size:34px;opacity:.5;margin-bottom:4px;}
.cr-lecteur-haut{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 18px;border-bottom:1px solid var(--line);background:var(--surface);}
.cr-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.cr-sep{width:1px;height:20px;background:var(--line-strong);margin:0 4px;}
.cr-retour{display:none;}
.cr-lecteur-corps{padding:22px 24px 40px;max-width:900px;}
.cr-titre{font-size:21px;font-weight:700;letter-spacing:-.02em;line-height:1.3;margin-bottom:16px;overflow-wrap:anywhere;}
.cr-meta{display:flex;align-items:center;gap:12px;margin-bottom:16px;}
.cr-avatar{flex:none;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--surface-2);border:1px solid var(--line-strong);font-weight:700;font-size:15px;}
.cr-meta-texte{flex:1;min-width:0;font-size:13.5px;overflow-wrap:anywhere;}
.cr-adresse{color:var(--muted);font-size:12.5px;}
.cr-meta-date{flex:none;font-size:12.5px;color:var(--muted);text-align:right;}
.cr-fil{margin-bottom:14px;border:1px solid var(--line);border-radius:10px;overflow:hidden;font-size:13px;}
.cr-fil summary{padding:9px 12px;cursor:pointer;color:var(--muted);}
.cr-fil-msg{display:flex;justify-content:space-between;gap:10px;width:100%;padding:8px 12px;border:0;border-top:1px solid var(--line);background:none;color:var(--text);font:inherit;font-size:13px;cursor:pointer;text-align:left;}
.cr-fil-msg:hover,.cr-fil-msg.actif{background:var(--surface-2);}
.cr-fil-msg span{color:var(--muted);flex:none;}
.cr-pieces{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px;}
.cr-piece{display:inline-flex;align-items:center;gap:8px;padding:7px 12px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface-2);color:var(--text);font:inherit;font-size:13px;cursor:pointer;max-width:100%;}
.cr-piece:hover{border-color:var(--signal);} .cr-piece small{color:var(--muted);} .cr-piece:disabled{opacity:.6;cursor:wait;}
.cr-avis{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px;padding:9px 12px;border-radius:10px;background:var(--info-soft);color:var(--info);font-size:13px;}
.cr-cadre{display:block;width:100%;min-height:160px;height:420px;border:1px solid var(--line);border-radius:10px;background:#fff;}

/* Volet de lecture en dessous */
.cr[data-volet="dessous"]{grid-template-columns:232px minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1.2fr);}
.cr[data-volet="dessous"] .cr-colonne{grid-row:1 / span 2;}
.cr[data-volet="dessous"] .cr-liste{border-right:0;border-bottom:1px solid var(--line);}

/* Mise en page adaptative : elle suit la largeur RÉELLEMENT disponible (le menu latéral en prend déjà une partie),
   pas celle de la fenêtre. Trois états : large (3 colonnes), moyen (dossiers en barre) et étroit (une vue à la fois). */
.cr-hote{container-type:inline-size;container-name:cr;}

@container cr (max-width: 1060px){
  .cr,.cr[data-volet="dessous"]{grid-template-columns:minmax(260px,330px) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);height:calc(100vh - 178px);}
  .cr-colonne,.cr[data-volet="dessous"] .cr-colonne{grid-column:1 / -1;grid-row:1;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:10px 14px;border-right:0;border-bottom:1px solid var(--line);overflow:visible;}
  .cr-ecrire{width:auto;}
  .cr-boites{flex-direction:row;}
  .cr-boites button{padding:7px 12px;}
  .cr-dossiers{flex-direction:row;flex:1 1 100%;flex-wrap:wrap;min-width:0;gap:4px;}
  .cr-dossier{width:auto;white-space:nowrap;padding:7px 10px;}
  .cr-dossier.actif::before{display:none;}
  .cr-liste,.cr[data-volet="dessous"] .cr-liste{grid-row:2;border-bottom:0;border-right:1px solid var(--line);}
  .cr-lecteur{grid-row:2;}
  .cr-lecteur-haut{padding:8px 14px;}
  .cr-lecteur-corps{padding:18px 18px 32px;}
}

@container cr (max-width: 720px){
  .cr,.cr[data-volet="dessous"]{display:flex;flex-direction:column;height:auto;min-height:0;}
  .cr-dossiers{flex-wrap:nowrap;overflow-x:auto;}
  .cr-liste{border-right:0;height:calc(100vh - 340px);min-height:360px;}
  .cr-lecteur{min-height:calc(100vh - 240px);}
  .cr[data-vue="liste"] .cr-lecteur{display:none;}
  .cr[data-vue="lecteur"] .cr-liste,.cr[data-vue="lecteur"] .cr-colonne{display:none;}
  .cr-retour{display:inline-flex;}
  .cr-lecteur-corps{padding:16px 14px 28px;}
  .cr-titre{font-size:19px;}
}

/* Petits retouches de lisibilité */
.cr-ligne{padding-left:20px;}
.cr-ligne.non-lu::before{left:7px;}
.cr-actions .abtn{white-space:nowrap;}
.cr-ic{min-width:34px;padding-left:9px;padding-right:9px;font-size:14px;}
.cr-svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px;}
.cr-svg.plein{fill:currentColor;}
.cr-dossier-ico{display:grid;place-items:center;width:18px;color:var(--muted);} .cr-dossier.actif .cr-dossier-ico{color:var(--text);}
.cr-etoile{display:grid;place-items:center;} .cr-etoile .cr-svg{width:17px;height:17px;} .cr-etoile.on{color:#f5b301;}
.cr-pj .cr-svg{width:13px;height:13px;vertical-align:-2px;margin-right:4px;}
.cr-actions .abtn .cr-svg{margin-right:2px;} .cr-ic .cr-svg{margin:0;}
#ac-etoile .cr-svg.plein{color:#f5b301;}
.cr-vide-ico .cr-svg{width:34px;height:34px;stroke-width:1.4;}
.cr-piece .cr-svg{width:15px;height:15px;color:var(--muted);}
