/* Secrétariat Hermès — thème sombre, mobile d'abord, aucun CDN. */
@font-face { font-family: 'Archivo'; src: url('/static/polices/archivo-800-latin.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/static/polices/archivo-700-latin.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('/static/polices/inter-tight-400-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('/static/polices/inter-tight-500-latin.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('/static/polices/inter-tight-600-latin.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('/static/polices/inter-tight-700-latin.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --fond: #0E1013;
  --surface: #161A20;
  --surface-2: #1D222B;
  --surface-3: #242A34;
  --bord: #262C36;
  --bord-focus: #3A424F;
  --texte: #EDEFF3;
  --doux: #98A1B0;
  --tres-doux: #6C7482;
  --accent: #D93A32;
  --accent-clair: #EE5147;
  --accent-fonce: #BD1719;
  --vert: #37C77E;
  --rouge-doux: #FF8B84;
  --fond-translucide: rgba(14, 16, 19, .92);
  --fond-translucide-2: rgba(16, 18, 22, .97);
  --voile-fond: rgba(0, 0, 0, .5);
  --voile-fond-fort: rgba(0, 0, 0, .6);
  --code-fond: rgba(255, 255, 255, .09);
  --pre-fond: #0B0D10;
  --cat-facture: #7FE0AE;
  --cat-devis: #9CC0FF;
  --cat-banque: #E8CE93;
  --cat-urgent: #FFB4AE;
  --degrade-connexion: radial-gradient(1100px 620px at 50% -10%, #221A1A 0%, #0E1013 55%, #0B0D10 100%);
  --ombre: 0 18px 40px rgba(0, 0, 0, .45);
  --barre-haut: 58px;
  color-scheme: dark;
}

/* Thème clair : mêmes jetons, valeurs inversées. Il le veut dans les deux. */
:root[data-theme="clair"] {
  --fond: #F1F3F7;
  --surface: #FFFFFF;
  --surface-2: #F5F7FA;
  --surface-3: #E9EDF3;
  --bord: #E0E5EC;
  --bord-focus: #C3CBD6;
  --texte: #131820;
  --doux: #5B6575;
  --tres-doux: #8A93A2;
  --accent: #C62B24;
  --accent-clair: #D93A32;
  --accent-fonce: #A31316;
  --vert: #128C56;
  --rouge-doux: #B3261E;
  --fond-translucide: rgba(255, 255, 255, .88);
  --fond-translucide-2: rgba(255, 255, 255, .94);
  --voile-fond: rgba(17, 24, 39, .35);
  --voile-fond-fort: rgba(17, 24, 39, .45);
  --code-fond: rgba(17, 24, 39, .07);
  --pre-fond: #F2F4F8;
  --cat-facture: #0F7B4B;
  --cat-devis: #1D5FC4;
  --cat-banque: #8A6A11;
  --cat-urgent: #B3261E;
  --degrade-connexion: radial-gradient(1100px 620px at 50% -10%, #FFE7E5 0%, #F1F3F7 55%, #E9EDF3 100%);
  --ombre: 0 14px 30px rgba(16, 24, 40, .10);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, strong, .titre-fil strong { font-family: 'Archivo', 'Inter Tight', sans-serif; letter-spacing: -.01em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--accent-clair); }
.cacher { display: none !important; }
.lien { color: var(--doux); text-decoration: underline; font-size: 14px; }

/* ───────────── connexion ───────────── */
.page-connexion { display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--degrade-connexion); }
.carte-connexion { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 22px; padding: 30px 24px 22px; box-shadow: var(--ombre); }
.marque { text-align: center; margin-bottom: 18px; }
.marque-logo { display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 16px; font-family: 'Archivo', sans-serif; font-weight: 800;
  font-size: 28px; color: #fff; background: linear-gradient(145deg, var(--accent-clair), var(--accent-fonce));
  box-shadow: 0 10px 24px rgba(189, 23, 25, .35); }
.marque-logo.petit { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; }
.marque-logo.grand { width: 68px; height: 68px; border-radius: 20px; font-size: 34px; margin-bottom: 12px; }
.marque h1 { margin: 12px 0 2px; font-size: 27px; }
.marque-sous { margin: 0; color: var(--doux); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.carte-intro { color: var(--doux); font-size: 14px; text-align: center; margin: 0 0 20px; }
.champ { display: block; margin-bottom: 12px; }
.champ > span:first-child { display: block; font-size: 13px; color: var(--doux); margin-bottom: 6px; font-weight: 500; }
.champ-saisie { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--bord);
  border-radius: 13px; padding: 0 6px 0 12px; }
.champ input, .champ select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte);
  border-radius: 13px; padding: 13px 12px; font-size: 16px; font-family: inherit; outline: none; }
.champ-saisie input { border: none; background: transparent; padding: 13px 0; }
.champ input:focus, .champ select:focus, .champ-saisie:focus-within { border-color: var(--accent); }
.champ-saisie:focus-within { border-color: var(--accent); }
.oeil { color: var(--doux); font-size: 13px; padding: 10px 8px; }
.case { display: flex; align-items: center; gap: 9px; color: var(--doux); font-size: 14px; margin: 4px 0 14px; }
.case input { width: 17px; height: 17px; accent-color: var(--accent); }
.bouton-principal { width: 100%; background: linear-gradient(145deg, var(--accent-clair), var(--accent));
  color: #fff; font-weight: 600; font-size: 16px; padding: 14px; border-radius: 14px;
  box-shadow: 0 10px 22px rgba(217, 58, 50, .28); }
.bouton-principal:active { transform: translateY(1px); }
.bouton-principal:disabled { opacity: .6; }
.bouton-secondaire { width: 100%; background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte);
  font-weight: 600; padding: 12px; border-radius: 13px; font-size: 15px; }
.erreur { display: none; color: var(--rouge-doux); font-size: 14px; margin: 0 0 12px; }
.erreur.visible { display: block; }
.pied { color: var(--tres-doux); font-size: 12px; text-align: center; margin: 16px 0 0; }

/* ───────────── application ───────────── */
.page-app { display: flex; flex-direction: column; height: 100dvh; }
.barre-haut { position: fixed; top: 0; left: 0; right: 0; height: var(--barre-haut); z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: var(--fond-translucide); backdrop-filter: blur(14px); border-bottom: 1px solid var(--bord); }
.bouton-icone { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; color: var(--doux); }
.bouton-icone:active { background: var(--surface-2); }
.traits { display: flex; flex-direction: column; gap: 4px; }
.traits i { display: block; width: 19px; height: 2px; background: var(--texte); border-radius: 2px; }
.titre-fil { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.titre-fil strong { font-size: 15.5px; font-weight: 700; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 11px; font-weight: 600; color: var(--accent-clair); background: rgba(217, 58, 50, .14);
  border: 1px solid rgba(217, 58, 50, .3); padding: 1px 8px; border-radius: 999px; }

.fil { flex: 1; overflow-y: auto; padding: calc(var(--barre-haut) + 14px) 14px 8px; scroll-behavior: smooth; }
.accueil { max-width: 460px; margin: 6vh auto 0; text-align: center; color: var(--doux); }
.accueil h2 { color: var(--texte); font-size: 22px; margin: 0 0 8px; }
.accueil p { font-size: 14.5px; }

.msg { display: flex; margin-bottom: 10px; animation: apparait .18s ease-out; }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.moi { justify-content: flex-end; }
.bulle { max-width: 84%; padding: 11px 14px; border-radius: 18px; position: relative; font-size: 15px; overflow-wrap: anywhere; }
.msg.moi .bulle { background: linear-gradient(150deg, var(--accent-clair), var(--accent-fonce)); color: #fff;
  border-bottom-right-radius: 6px; }
.msg.hermes .bulle { background: var(--surface-2); border: 1px solid var(--bord); border-bottom-left-radius: 6px; }
.bulle p { margin: 0 0 8px; } .bulle p:last-child { margin-bottom: 0; }
.bulle ul, .bulle ol { margin: 6px 0; padding-left: 20px; }
.bulle li { margin-bottom: 3px; }
.bulle code { background: var(--code-fond); padding: 1px 5px; border-radius: 5px; font-size: 13.5px; }
.bulle pre { background: var(--pre-fond); border: 1px solid var(--bord); padding: 10px; border-radius: 10px; overflow-x: auto; font-size: 13px; }
.bulle img { max-width: 100%; border-radius: 12px; margin-top: 6px; display: block; }
.bulle h3 { font-size: 15px; margin: 10px 0 4px; }
.horodatage { font-size: 11px; color: var(--tres-doux); margin-top: 5px; }
.msg.moi .horodatage { color: rgba(255,255,255,.72); }
.bulle-outils { display: flex; gap: 10px; margin-top: 7px; }
.bulle-outils button { font-size: 12px; color: var(--doux); }
.activite { display: inline-flex; align-items: center; gap: 7px; color: var(--doux); font-size: 13px;
  background: var(--surface); border: 1px solid var(--bord); padding: 6px 12px; border-radius: 999px; margin-bottom: 10px; }
.points { display: inline-flex; gap: 3px; }
.points i { width: 5px; height: 5px; border-radius: 50%; background: var(--doux); animation: pulsation 1.1s infinite; }
.activite.avancement { display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  width: 100%; max-width: 420px; border-radius: 14px; padding: 10px 12px; }
.activite .barre { display: block; height: 6px; border-radius: 999px; background: var(--surface-3);
  overflow: hidden; }
.activite .barre .remplie { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-clair), var(--accent)); transition: width .4s ease; }
.activite .etape { font-size: 12.5px; color: var(--doux); }
.activite .etape strong { color: var(--texte); }
.points i:nth-child(2) { animation-delay: .18s; } .points i:nth-child(3) { animation-delay: .36s; }
@keyframes pulsation { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.erreur-bulle { background: rgba(217, 58, 50, .12); border: 1px solid rgba(217, 58, 50, .4); color: var(--cat-urgent); }

.suggestions { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.suggestions button { flex: 0 0 auto; background: var(--surface); border: 1px solid var(--bord); color: var(--doux);
  font-size: 13.5px; padding: 8px 13px; border-radius: 999px; white-space: nowrap; }
.suggestions button:active { background: var(--surface-3); }

.barre-bas { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--fond-translucide); border-top: 1px solid var(--bord); backdrop-filter: blur(14px); }
#saisie { flex: 1; background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte);
  border-radius: 21px; padding: 11px 15px; font-size: 16px; font-family: inherit; resize: none;
  max-height: 132px; outline: none; line-height: 1.45; }
#saisie:focus { border-color: var(--bord-focus); }
.bouton-micro, .bouton-envoyer { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; }
.bouton-micro svg, .bouton-envoyer svg { width: 21px; height: 21px; display: block; }
.bouton-micro { background: var(--surface-2); border: 1px solid var(--bord); color: var(--doux); }
.bouton-micro .ico-stop { display: none; }
.bouton-micro.enregistre { background: var(--accent); border-color: var(--accent); color: #fff; animation: battement 1.3s infinite; }
.bouton-micro.enregistre .ico-micro { display: none; }
.bouton-micro.enregistre .ico-stop { display: block; }
@keyframes battement { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,58,50,.55); } 50% { box-shadow: 0 0 0 12px rgba(217,58,50,0); } }
.bouton-envoyer { background: linear-gradient(145deg, var(--accent-clair), var(--accent)); color: #fff;
  font-size: 21px; font-weight: 700; }
.bouton-envoyer:disabled { opacity: .45; }

.tiroir { position: fixed; top: 0; bottom: 0; left: 0; width: 84%; max-width: 330px; z-index: 60;
  background: var(--surface); border-right: 1px solid var(--bord); padding: 16px 14px;
  display: flex; flex-direction: column; gap: 12px; transform: translateX(-102%); transition: transform .22s ease;
  padding-top: calc(16px + env(safe-area-inset-top)); }
.tiroir.ouvert { transform: none; box-shadow: var(--ombre); }
.tiroir-entete { display: flex; align-items: center; gap: 11px; padding-bottom: 4px; }
.tiroir-entete div { display: flex; flex-direction: column; }
.tiroir-entete span:last-child { color: var(--doux); font-size: 12.5px; }
.liste-fils { flex: 0 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.entree-fil { text-align: left; padding: 11px 12px; border-radius: 13px; display: flex; flex-direction: column; gap: 3px; }
.menu-sections, .menu-entreprises { display: flex; flex-direction: column; gap: 3px; }
.menu-sections { border-bottom: 1px solid var(--bord); padding-bottom: 10px; }
.menu-bloc { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.menu-bloc-conversations { flex: 1; min-height: 0; }
.menu-titre { display: flex; align-items: baseline; justify-content: space-between; color: var(--tres-doux);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 0 4px; }
.menu-titre button { text-transform: none; letter-spacing: 0; font-size: 12px; }
.entree-menu { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 11px;
  border-radius: 12px; color: var(--texte); font-size: 14.5px; font-weight: 500; }
.entree-menu svg { width: 19px; height: 19px; color: var(--doux); flex: 0 0 auto; }
.entree-menu span.nom { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entree-menu.actif { background: var(--surface-2); font-weight: 600; }
.entree-menu.actif svg { color: var(--accent-clair); }
.entree-menu .compte { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 999px; padding: 1px 7px; }
.entree-menu .compte.rien { background: var(--surface-3); color: var(--tres-doux); }
.entree-societe { padding-left: 11px; }
.menu-vide { color: var(--tres-doux); font-size: 12.5px; padding: 6px 4px; }
.entree-societe .pastille-soc { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  flex: 0 0 auto; }
.entree-societe .pastille-soc.vide { background: var(--bord); }

/* ───────────── ordinateur : menu à gauche ───────────── */
@media (min-width: 780px) {
  .page-app { flex-direction: column; }
  .tiroir { transform: none; position: fixed; top: 0; bottom: 0; width: 286px; box-shadow: none;
    border-right: 1px solid var(--bord); }
  .voile { display: none !important; }
  .barre-haut { left: 286px; padding-left: 18px; }
  #ouvrir-tiroir { display: none; }
  #fil, #vue-courrier, #vue-taches, #barre-suggestions, #file-attente, .barre-bas { margin-left: 286px; }
  .barre-haut .titre-fil { align-items: flex-start; }
  .barre-onglets { display: none; }
  body.mode-courrier .barre-bas, body.mode-taches .barre-bas { display: none; }
  .fil { padding-left: 20px; padding-right: 20px; }
  .bulle { max-width: 74%; }
  .barre-bas { padding-left: 20px; padding-right: 20px; }
  #saisie { font-size: 15px; }
  .liste-mails, .liste-taches { padding-left: 20px; padding-right: 20px; }
  .ajout-tache { padding-left: 20px; padding-right: 20px; }
}
.entree-fil:active { background: var(--surface-2); }
.entree-fil.actif { background: var(--surface-2); border: 1px solid var(--bord); }
.entree-fil strong { font-size: 14.5px; font-weight: 600; }
.entree-fil small { color: var(--tres-doux); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entree-fil .etiquette { font-size: 11px; color: var(--accent-clair); }
.voile { position: fixed; inset: 0; background: var(--voile-fond); z-index: 50; display: none; }
.voile.ouvert { display: block; }
.tiroir-pied { border-top: 1px solid var(--bord); padding-top: 12px; }

/* ───────────── choix du thème ───────────── */
.theme-choix { border-top: 1px solid var(--bord); padding-top: 12px; }
.theme-titre { display: block; color: var(--tres-doux); font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 7px; }
.theme-boutons { display: flex; gap: 6px; }
.theme-boutons button { flex: 1; background: var(--surface-2); border: 1px solid var(--bord);
  color: var(--doux); font-size: 13px; font-weight: 600; padding: 9px 0; border-radius: 11px; }
.theme-boutons button.actif { background: rgba(217, 58, 50, .16); border-color: rgba(217, 58, 50, .45);
  color: var(--accent-clair); }

.fenetre { position: fixed; inset: 0; z-index: 70; background: var(--voile-fond-fort); display: flex;
  align-items: flex-end; justify-content: center; padding: 16px; }
.fenetre-boite { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 20px; padding: 20px; margin-bottom: 8px; }
.fenetre-boite h3 { margin: 0 0 14px; font-size: 18px; }
.fenetre-actions { display: flex; gap: 10px; margin-top: 6px; }
.fenetre-note { color: var(--doux); font-size: 13.5px; margin: 0 0 14px; }
#badge-societe { cursor: pointer; }
.bouton-faceid { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte); font-weight: 600;
  font-size: 15.5px; padding: 13px; border-radius: 14px; margin-bottom: 12px; }
.bouton-faceid svg { width: 22px; height: 22px; }
.ou-bien { text-align: center; color: var(--tres-doux); font-size: 12.5px; margin: 0 0 12px; }
.ou-bien span { display: inline-block; padding: 0 10px; }
.faceid-etat { min-height: 0; margin: 10px 0 0; }
.faceid-etat .bon { color: var(--vert); }
.faceid-etat .mauvais { color: var(--rouge-doux); }
.liste-appareils { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ligne-appareil { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px;
  font-size: 13.5px; }
.ligne-appareil small { display: block; color: var(--tres-doux); font-size: 11.5px; }
.ligne-appareil button { background: none; border: none; color: var(--rouge-doux); font-size: 13px; font-weight: 600; }
#ouvrir-faceid { margin-bottom: 10px; }
.tiroir-pied { display: flex; flex-direction: column; }
.toast { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 80;
  background: var(--surface-3); border: 1px solid var(--bord); color: var(--texte); font-size: 14px;
  padding: 10px 16px; border-radius: 999px; box-shadow: var(--ombre); }

/* ───────────── onglets ───────────── */
.barre-onglets { display: flex; border-top: 1px solid var(--bord); background: var(--fond-translucide-2);
  backdrop-filter: blur(14px); padding-bottom: env(safe-area-inset-bottom); }
.onglet { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; font-size: 11.5px; font-weight: 500; color: var(--tres-doux); position: relative; }
.onglet svg { width: 22px; height: 22px; }
.onglet.actif { color: var(--texte); }
.onglet.actif::before { content: ''; position: absolute; top: 0; width: 34px; height: 2px;
  border-radius: 2px; background: var(--accent); }
.pastille { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
#pastille-courrier { position: absolute; top: 5px; left: 50%; margin-left: 6px; }

/* ───────────── courrier ───────────── */
body.mode-courrier #barre-suggestions, body.mode-courrier .barre-bas { display: none; }
.entete-vue { padding: 2px 0 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; background: var(--surface); border: 1px solid var(--bord);
  color: var(--doux); font-size: 13px; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.chips button.actif { background: rgba(217, 58, 50, .16); border-color: rgba(217, 58, 50, .45);
  color: var(--accent-clair); font-weight: 600; }
.ligne-releve { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 14px 8px; color: var(--tres-doux); font-size: 12.5px; }
.bouton-petit { background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte);
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.bouton-petit:disabled { opacity: .55; }
.liste-mails { padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.carte-mail { background: var(--surface); border: 1px solid var(--bord); border-radius: 16px;
  padding: 12px 13px; cursor: pointer; }
.carte-mail.urgent { border-color: rgba(217, 58, 50, .55); }
.carte-mail.traite { opacity: .5; }
.carte-entete { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; flex-wrap: wrap; }
.carte-entete .badge { font-size: 10.5px; padding: 1px 7px; }
.badge-cat { font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--doux); text-transform: capitalize; }
.badge-cat.facture { background: rgba(55, 199, 126, .16); color: var(--cat-facture); }
.badge-cat.devis { background: rgba(90, 150, 255, .16); color: var(--cat-devis); }
.badge-cat.client { background: rgba(217, 58, 50, .16); color: var(--accent-clair); }
.badge-cat.banque { background: rgba(230, 190, 90, .16); color: var(--cat-banque); }
.badge-cat.urgent-tag { background: rgba(217, 58, 50, .2); color: var(--cat-urgent); font-weight: 700; }
.carte-mail h4 { margin: 0 0 3px; font-family: 'Inter Tight', sans-serif; font-size: 14.5px;
  font-weight: 600; line-height: 1.35; }
.carte-mail .exp { color: var(--doux); font-size: 12.5px; margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-mail .extra { color: var(--tres-doux); font-size: 13px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-mail .quand { color: var(--tres-doux); font-size: 11.5px; margin-top: 7px; }
.carte-actions { display: flex; gap: 8px; margin-top: 10px; }
.carte-actions button { font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte); }
.carte-actions button.principal { background: linear-gradient(145deg, var(--accent-clair), var(--accent));
  border-color: transparent; color: #fff; }
.fin-liste { text-align: center; color: var(--tres-doux); font-size: 13px; padding: 18px 0 6px; }

/* ───────────── agenda ───────────── */
body.mode-agenda #barre-suggestions, body.mode-agenda .barre-bas { display: none; }
#vue-agenda { display: flex; flex-direction: column; }
.liste-agenda { padding: 4px 14px 18px; display: flex; flex-direction: column; gap: 14px; }
.jour-agenda { display: flex; flex-direction: column; gap: 8px; }
.jour-titre { display: flex; align-items: baseline; gap: 8px; color: var(--doux); font-size: 12.5px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 0 2px; }
.jour-titre .pastille-jour { color: #fff; background: var(--accent); border-radius: 999px;
  font-size: 11px; padding: 1px 7px; }
.carte-rdv { display: flex; gap: 11px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 15px; padding: 11px 13px; }
.carte-rdv.aujourdhui { border-color: rgba(217, 58, 50, .5); }
.rdv-heure { flex: 0 0 54px; font-weight: 700; font-size: 13.5px; color: var(--texte); }
.rdv-heure small { display: block; color: var(--tres-doux); font-weight: 500; font-size: 11.5px; }
.rdv-corps { flex: 1; min-width: 0; }
.rdv-corps h4 { margin: 0 0 4px; font-family: 'Inter Tight', sans-serif; font-size: 15px;
  font-weight: 600; line-height: 1.35; }
.rdv-lieu { color: var(--doux); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.rdv-actions { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.rdv-actions button, .rdv-actions a { font-size: 12.5px; font-weight: 600; padding: 7px 11px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--bord);
  color: var(--texte); text-decoration: none; }
.rdv-actions button.principal { background: linear-gradient(145deg, var(--accent-clair), var(--accent));
  border-color: transparent; color: #fff; }
.champ-double { display: flex; gap: 10px; }
.champ-double .champ { flex: 1; }
body.mode-taches #barre-suggestions, body.mode-taches .barre-bas { display: none; }
#vue-taches { display: flex; flex-direction: column; }
.liste-taches { padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 9px; }
.carte-tache { display: flex; gap: 11px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 15px; padding: 12px 13px; }
.carte-tache.retard { border-color: rgba(217, 58, 50, .5); }
.case-fait { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; margin-top: 1px;
  border: 1.8px solid var(--bord); background: var(--surface-2); display: flex;
  align-items: center; justify-content: center; color: transparent; }
.case-fait:active { background: var(--surface-3); }
.case-fait svg { width: 15px; height: 15px; }
.carte-tache.faite .case-fait { background: var(--vert); border-color: var(--vert); color: #fff; }
.carte-tache.faite h4 { text-decoration: line-through; color: var(--tres-doux); }
.tache-corps { flex: 1; min-width: 0; }
.tache-corps h4 { margin: 0 0 6px; font-family: 'Inter Tight', sans-serif; font-size: 15px;
  font-weight: 600; line-height: 1.35; }
.tache-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tache-badges .badge { font-size: 10.5px; padding: 1px 8px; }
.echeance { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--doux); }
.echeance.retard { background: rgba(217, 58, 50, .2); color: var(--cat-urgent); }
.echeance.aujourdhui { background: rgba(230, 190, 90, .18); color: var(--cat-banque); }
.echeance.attente { background: rgba(90, 150, 255, .16); color: var(--cat-devis); }
.tache-detail { color: var(--tres-doux); font-size: 12.5px; margin-top: 6px; }
.tache-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tache-actions button { font-size: 12.5px; font-weight: 600; padding: 7px 11px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte); }
.tache-actions button.principal { background: linear-gradient(145deg, var(--accent-clair), var(--accent));
  border-color: transparent; color: #fff; }
.ajout-tache { position: sticky; bottom: 0; margin-top: auto; padding: 10px 14px 14px;
  background: linear-gradient(180deg, rgba(14,16,19,.2), var(--fond) 35%); }
.ajout-tache input#tache-titre { width: 100%; background: var(--surface-2); border: 1px solid var(--bord);
  color: var(--texte); border-radius: 13px; padding: 12px 13px; font-size: 16px; font-family: inherit; }
.ajout-ligne { display: flex; gap: 8px; margin-top: 8px; }
.ajout-ligne select, .ajout-ligne input[type=date] { flex: 1; min-width: 0; background: var(--surface-2);
  border: 1px solid var(--bord); color: var(--texte); border-radius: 12px; padding: 10px 11px;
  font-size: 14px; font-family: inherit; }
.ajout-ligne button { flex: 0 0 auto; }
.file-attente { padding: 7px 16px 0; color: var(--doux); font-size: 12.5px; }
.msg.moi .bulle.en-attente { opacity: .6; }
.msg.moi .bulle.en-attente::after { content: ' · en attente'; font-size: 11px; }

/* À la fin du fichier : ces règles doivent gagner sur celles définies plus haut. */
@media (min-width: 780px) {
  .barre-onglets { display: none; }
  .tiroir { transform: none; }
}

/* Menu de gauche : chaque bloc a sa place, la liste des conversations défile seule.
   Sans ça, avec 7 entreprises + des conversations, les blocs se chevauchaient
   (vécu le 03/10/2026 sur grand écran). */
.tiroir { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.menu-sections, .menu-bloc, .theme-choix, .tiroir-pied, #tiroir-nouveau, .tiroir-entete { flex: 0 0 auto; }
.menu-bloc-conversations { flex: 1 1 auto; min-height: 0; }
.menu-entreprises { max-height: 24vh; overflow-y: auto; }
.liste-fils { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* ───────────── factures ───────────── */
body.mode-factures .barre-bas, body.mode-factures #barre-suggestions { display: none; }
#vue-factures { display: flex; flex-direction: column; }
.liste-factures { padding: 4px 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.note-factures { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 13px;
  padding: 10px 12px; font-size: 12.5px; color: var(--doux); line-height: 1.5; }
.carte-facture { background: var(--surface); border: 1px solid var(--bord); border-radius: 15px;
  padding: 12px 13px; }
.carte-facture.retard { border-color: rgba(217, 58, 50, .45); }
.facture-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.etiquette { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--doux); background: var(--surface-2);
  border: 1px solid var(--bord); border-radius: 999px; padding: 2px 8px; margin-right: 7px; }
.facture-client { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: 14.5px; }
.facture-montant { font-size: 15px; white-space: nowrap; }
.facture-detail { margin-top: 7px; color: var(--doux); font-size: 12.5px; }
.facture-etat { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--doux); }
.facture-etat.retard { color: #d93a32; }
.facture-etat.a_verifier { color: #b98118; }
.facture-objet { margin-top: 6px; color: var(--tres-doux); font-size: 12px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.facture-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.facture-actions button, .facture-actions a { font-size: 12.5px; font-weight: 600; padding: 7px 11px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte);
  text-decoration: none; }
.facture-actions button.principal { background: linear-gradient(145deg, var(--accent-clair), var(--accent));
  border-color: transparent; color: #fff; }
