/* ============================================================
   FAXTRIX APP — habillage de l'application (démo fonctionnelle)
   Réutilise les tokens et composants de style.css (chargé avant ce fichier)
   ============================================================ */

body.app-body{
  min-height:100vh;
  /* --- FAXTRIX LIQUID DESIGN SYSTEM : jetons clairs par défaut --- */
  --surf-page:#F8FBFF;
  --surf-halo-1:rgba(255,122,0,.10);
  --surf-halo-2:rgba(223,247,255,.9);
  --glass-1:rgba(255,255,255,.68);      /* niveau CRYSTAL */
  --glass-1-line:rgba(255,255,255,.9);
  --glass-2:rgba(255,255,255,.78);      /* niveau FROSTED */
  --glass-2-line:rgba(255,255,255,.95);
  --scrim:rgba(7,26,47,.35);
  --text-1:#071A2F;
  --text-2:#55708A;
  --text-3:#8FA3B8;
  --hairline:rgba(7,26,47,.10);
  --hairline-soft:rgba(7,26,47,.06);
  --accent:#FF7A00;
  --accent-2:#FFB45C;
  --accent-pale:#FFF0DE;
  --aqua:#DFF7FF;
  --on-accent:#FFFFFF;
  --shadow-card:0 8px 30px rgba(30,100,140,.08);
  --shadow-frosted:0 12px 40px rgba(30,100,140,.10);
  background:
    radial-gradient(60% 50% at 8% 0%, var(--surf-halo-1), transparent 60%),
    radial-gradient(50% 45% at 100% 10%, rgba(85,200,245,.10), transparent 60%),
    var(--surf-page);
  color:var(--text-1);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
}
body.app-body[data-theme="dark"]{
  --surf-page:#071A2F;
  --surf-halo-1:rgba(255,122,0,.14);
  --surf-halo-2:rgba(85,200,245,.08);
  --glass-1:rgba(255,255,255,.06);
  --glass-1-line:rgba(255,255,255,.12);
  --glass-2:rgba(255,255,255,.09);
  --glass-2-line:rgba(255,255,255,.16);
  --scrim:rgba(2,8,16,.55);
  --text-1:#F4FAFF;
  --text-2:#B9C6D6;
  --text-3:#7C8CA0;
  --hairline:rgba(255,255,255,.12);
  --hairline-soft:rgba(255,255,255,.07);
  --accent:#FF8A1F;
  --accent-2:#FFC98A;
  --accent-pale:rgba(255,138,31,.12);
  --aqua:#55C8F5;
  --shadow-card:0 8px 30px rgba(0,0,0,.28);
  --shadow-frosted:0 12px 40px rgba(0,0,0,.34);
}
.app-hidden{ display:none !important; }

/* ---------------- écran de connexion ---------------- */
.gate{
  min-height:100vh; display:grid; place-items:center; padding:40px 20px;
  background:
    radial-gradient(60% 50% at 15% 0%, var(--surf-halo-1), transparent 60%),
    radial-gradient(50% 45% at 100% 100%, var(--surf-halo-2), transparent 60%),
    var(--surf-page);
}
.gate-card{
  width:min(400px,100%); border:1px solid var(--glass-2-line); border-radius:28px;
  background:var(--glass-2); backdrop-filter:blur(32px); -webkit-backdrop-filter:blur(32px); padding:38px 34px;
  box-shadow:var(--shadow-frosted);
}
.gate-logo{ display:flex; align-items:center; gap:12px; margin-bottom:28px; }
.gate-logo img{ height:38px; filter:drop-shadow(0 4px 16px rgba(255,122,0,.35)); }
.gate-logo b{ font-family:'Inter',sans-serif; font-size:19px; font-weight:800; color:var(--text-1); }
.gate-logo span{ display:block; font-family:'Martian Mono',monospace; font-size:9.5px; color:var(--text-3); letter-spacing:.06em; }
.gate-card h1{ font-size:23px; margin-bottom:8px; color:var(--text-1); }
.gate-card > p{ font-size:13.5px; color:var(--text-2); margin-bottom:26px; }
.gate-tabs{ display:flex; gap:6px; background:var(--glass-1); border:1px solid var(--hairline); border-radius:14px; padding:4px; margin-bottom:20px; }
.gate-tabs button{ flex:1; border:0; background:transparent; color:var(--text-2); font-size:12.5px; font-weight:600; padding:9px 6px; border-radius:10px; cursor:pointer; transition:all .15s ease; }
.gate-tabs button.active{ background:linear-gradient(90deg,var(--accent),var(--accent-2)); color:var(--on-accent); }
.gate-row{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px; color:var(--text-2); margin:2px 0 20px; }
.gate-row label{ display:flex; align-items:center; gap:7px; }
.gate-divider{ display:flex; align-items:center; gap:12px; margin:22px 0; color:var(--text-3); font-family:'Martian Mono',monospace; font-size:10.5px; }
.gate-divider::before, .gate-divider::after{ content:''; flex:1; height:1px; background:var(--hairline); }
.gate-note{ margin-top:16px; font-size:11.5px; color:var(--text-3); text-align:center; line-height:1.6; }
.gate-banner{
  margin-top:22px; border:1px solid rgba(255,122,0,.22); background:var(--accent-pale);
  border-radius:14px; padding:12px 14px; font-size:11.5px; color:var(--text-2); line-height:1.6;
}

/* ---------------- coquille de l'app ---------------- */
.app-shell{ display:grid; grid-template-columns:240px 1fr; min-height:100vh; }

/* barre latérale */
.app-side{
  border-right:1px solid var(--hairline); background:var(--glass-1); backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px);
  display:flex; flex-direction:column; padding:22px 16px; position:sticky; top:0; height:100vh;
}
.app-side-logo{ display:flex; align-items:center; gap:10px; padding:6px 8px 26px; }
.app-side-logo img{ height:28px; }
.app-side-logo b{ font-family:'Inter',sans-serif; font-size:15.5px; font-weight:800; color:var(--text-1); }
.app-nav{ display:flex; flex-direction:column; gap:3px; flex:1; }
.app-nav button{
  display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:12px; border:0; background:none;
  color:var(--text-2); font-family:inherit; font-size:14px; cursor:pointer; text-align:left; transition:all .2s var(--ease);
}
.app-nav button svg{ width:17px; height:17px; flex:none; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.app-nav button:hover{ background:var(--hairline-soft); color:var(--text-1); }
.app-nav button.active{ background:var(--accent-pale); color:var(--text-1); box-shadow:inset 0 0 0 1px rgba(255,122,0,.25); }
.app-nav button.active svg{ stroke:var(--accent); }
.app-side-foot{ border-top:1px solid var(--hairline-soft); padding-top:14px; margin-top:10px; }
.app-reset{ width:100%; font-size:11.5px; color:var(--text-3); background:none; border:1px dashed var(--hairline); border-radius:10px; padding:9px; cursor:pointer; }
.app-reset:hover{ color:var(--crit); border-color:rgba(233,75,75,.35); }
/* zone principale */
.app-main{ min-width:0; display:flex; flex-direction:column; }
.app-top{
  display:flex; align-items:center; gap:16px; padding:16px 28px; border-bottom:1px solid var(--hairline-soft);
  position:sticky; top:0; background:var(--glass-1); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); z-index:20;
}
.app-top h2{ font-size:19px; color:var(--text-1); }
.app-top .sub{ font-size:12.5px; color:var(--text-2); margin-top:2px; }
.app-top-actions{ margin-left:auto; display:flex; align-items:center; gap:14px; }
.app-icon-btn{
  position:relative; width:38px; height:38px; border-radius:50%; border:1px solid var(--hairline); background:var(--glass-1);
  display:grid; place-items:center; color:var(--text-2); cursor:pointer; transition:all .2s ease;
}
.app-icon-btn:hover{ color:var(--text-1); border-color:rgba(255,122,0,.4); }
.app-icon-btn svg{ width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:1.7; }
.app-badge{ position:absolute; top:-3px; right:-3px; min-width:16px; height:16px; padding:0 3px; border-radius:9px; background:var(--crit); color:#fff; font-size:9.5px; display:grid; place-items:center; font-family:'Martian Mono',monospace; }
.app-user{ display:flex; align-items:center; gap:10px; cursor:pointer; padding:5px 10px 5px 5px; border-radius:100px; border:1px solid var(--hairline); background:var(--glass-1); }
.app-user-av{ width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent-2)); display:grid; place-items:center; font-family:'Inter',sans-serif; font-weight:700; font-size:12px; color:var(--on-accent); }
.app-user span{ font-size:13px; color:var(--text-1); }

.app-body-area{ padding:28px; flex:1; }
.app-panel{ display:none; }
.app-panel.active{ display:block; animation:panelIn .4s var(--ease-out); }
@keyframes panelIn{ from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none; } }

.demo-banner{
  display:flex; align-items:center; gap:12px; border:1px solid rgba(255,122,0,.22); background:var(--accent-pale);
  color:var(--text-1); border-radius:16px; padding:12px 16px; font-size:12.5px; margin-bottom:24px; line-height:1.6;
}
.demo-banner b{ font-weight:600; }

/* stats + grilles */
.app-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:26px; }
.app-stat{ border:1px solid var(--glass-1-line); border-radius:20px; padding:18px 20px; background:var(--glass-1); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); box-shadow:var(--shadow-card); }
.app-stat b{ display:block; font-family:'Inter',sans-serif; font-size:26px; color:var(--text-1); }
.app-stat span{ font-size:11.5px; color:var(--text-3); font-family:'Martian Mono',monospace; }
.app-grid2{ display:grid; grid-template-columns:1.3fr 1fr; gap:20px; }
.app-card{ border:1px solid var(--glass-2-line); border-radius:24px; padding:22px; background:var(--glass-2); backdrop-filter:blur(28px); -webkit-backdrop-filter:blur(28px); box-shadow:var(--shadow-frosted); }
.app-card h3{ font-size:15.5px; margin-bottom:16px; color:var(--text-1); }
.app-card-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }

/* barre d'outils de section */
.app-toolbar{ display:flex; align-items:center; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.app-tabs{ display:flex; gap:6px; background:var(--glass-1); border:1px solid var(--hairline); border-radius:100px; padding:4px; }
.app-tabs button{ border:0; background:none; color:var(--text-2); font-size:12.5px; padding:7px 14px; border-radius:100px; cursor:pointer; font-family:inherit; }
.app-tabs button.active{ background:var(--accent); color:var(--on-accent); font-weight:600; }
.app-search{ flex:1; min-width:160px; display:flex; align-items:center; gap:8px; border:1px solid var(--hairline); border-radius:100px; padding:8px 16px; background:var(--glass-1); }
.app-search svg{ width:15px; height:15px; stroke:var(--text-3); fill:none; stroke-width:1.8; }
.app-search input{ border:0; background:none; outline:none; color:var(--text-1); font-size:13px; font-family:inherit; width:100%; }

/* liste / table de données */
.app-list{ display:flex; flex-direction:column; border:1px solid var(--glass-1-line); border-radius:20px; overflow:hidden; background:var(--glass-1); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); box-shadow:var(--shadow-card); }
.app-row{ display:flex; align-items:center; gap:14px; padding:15px 20px; border-bottom:1px solid var(--hairline-soft); font-size:13.5px; }
.app-row:last-child{ border-bottom:0; }
.app-row:hover{ background:var(--hairline-soft); }
.app-row .r-main{ flex:1; min-width:0; }
.app-row .r-main b{ display:block; font-weight:500; font-size:14px; color:var(--text-1); }
.app-row .r-main span{ font-size:12px; color:var(--text-3); }
.app-row-actions{ display:flex; gap:6px; }
.row-btn{
  width:28px; height:28px; border-radius:8px; border:1px solid var(--hairline); background:none; color:var(--text-3);
  cursor:pointer; display:grid; place-items:center; transition:all .2s ease;
}
.row-btn:hover{ color:var(--text-1); border-color:rgba(255,122,0,.4); }
.row-btn svg{ width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.8; }
.app-empty{ padding:40px 20px; text-align:center; color:var(--text-3); font-size:13px; }

/* formulaire latéral (drawer) */
.app-drawer{
  position:fixed; inset:0; z-index:200; display:grid; grid-template-columns:1fr min(420px,92vw);
  opacity:0; visibility:hidden; transition:opacity .3s var(--ease),visibility .3s;
}
.app-drawer.on{ opacity:1; visibility:visible; }
.app-drawer-bg{ background:var(--scrim); backdrop-filter:blur(4px); }
.app-drawer-panel{
  background:var(--glass-2); backdrop-filter:blur(32px); -webkit-backdrop-filter:blur(32px); border-left:1px solid var(--glass-2-line); padding:30px; overflow-y:auto;
  transform:translateX(24px); transition:transform .4s var(--ease-out);
}
.app-drawer.on .app-drawer-panel{ transform:none; }
.app-drawer h3{ font-size:19px; margin-bottom:22px; color:var(--text-1); }
.app-drawer .contact-form{ background:none; border:0; padding:0; }
.app-drawer-close{
  float:right; width:30px; height:30px; border-radius:50%; border:1px solid var(--hairline); background:none;
  color:var(--text-2); font-size:17px; cursor:pointer; line-height:1;
}

/* automatisation */
.rule-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:14px 18px; border:1px solid var(--glass-1-line); background:var(--glass-1); border-radius:16px; margin-bottom:10px; font-size:13px; color:var(--text-1); }
.rule-row em{ font-style:normal; padding:5px 11px; border:1px solid rgba(255,122,0,.3); border-radius:100px; color:var(--accent); font-family:'Martian Mono',monospace; font-size:11px; }
.rule-row .r-x{ margin-left:auto; }

/* simulation */
.sim-slider{ margin-bottom:22px; }
.sim-slider .sl-head{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:8px; color:var(--text-1); }
.sim-slider .sl-head b{ color:var(--accent); font-family:'Martian Mono',monospace; }
.sim-slider input[type=range]{ width:100%; accent-color:var(--accent); }
.sim-result{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-top:24px; }
.sim-result div{ border:1px solid var(--glass-1-line); background:var(--glass-1); border-radius:16px; padding:16px; text-align:center; }
.sim-result b{ display:block; font-family:'Inter',sans-serif; font-size:22px; color:var(--text-1); }
.sim-result span{ font-size:11px; color:var(--text-3); }

/* profil */
.profile-row{ display:flex; justify-content:space-between; align-items:center; padding:16px 0; border-bottom:1px solid var(--hairline-soft); color:var(--text-1); }
.profile-row:last-child{ border-bottom:0; }

/* toasts */
.toast-wrap{ position:fixed; bottom:24px; right:24px; z-index:400; display:flex; flex-direction:column; gap:10px; }
.toast{
  border:1px solid var(--glass-2-line); background:var(--glass-2); backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px); border-radius:14px; padding:13px 18px; font-size:13px; color:var(--text-1);
  box-shadow:var(--shadow-frosted); display:flex; align-items:center; gap:10px; min-width:240px;
  animation:toastIn .35s var(--ease-out);
}
.toast i{ width:8px; height:8px; border-radius:50%; background:var(--accent); flex:none; }
.toast.ok i{ background:var(--mint); } .toast.crit i{ background:var(--crit); }
@keyframes toastIn{ from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none; } }

/* bascule de thème */
.theme-switch{ display:flex; gap:6px; background:var(--glass-1); border:1px solid var(--hairline); border-radius:100px; padding:4px; }
.theme-switch button{ border:0; background:none; color:var(--text-2); font-size:11.5px; padding:7px 11px; border-radius:100px; cursor:pointer; font-family:inherit; white-space:nowrap; }
.theme-switch button.active{ background:linear-gradient(90deg,var(--accent),var(--accent-2)); color:var(--on-accent); font-weight:600; }

@media (max-width:900px){
  .app-shell{ grid-template-columns:1fr; }
  .app-side{ position:fixed; left:0; top:0; bottom:0; width:230px; transform:translateX(-100%); transition:transform .35s var(--ease-out); z-index:120; }
  .app-side.open{ transform:none; }
  .app-stats{ grid-template-columns:repeat(2,1fr); }
  .app-grid2{ grid-template-columns:1fr; }
  .app-user span{ display:none; }
  .app-body-area{ padding:20px; }
  .app-top{ padding:14px 18px; }
  .sim-result{ grid-template-columns:1fr; }
}

/* ================= ANIMATIONS & FINITIONS SaaS ================= */
/* halos qui respirent */
body.app-body::before{
  content:''; position:fixed; inset:-20%; z-index:0; pointer-events:none;
  background:
    radial-gradient(35% 30% at 20% 15%, rgba(255,122,0,.10), transparent 70%),
    radial-gradient(30% 30% at 85% 80%, rgba(85,200,245,.10), transparent 70%);
  animation:halo 14s ease-in-out infinite alternate;
}
@keyframes halo{ from{ transform:translate3d(-2%,-1%,0) scale(1); } to{ transform:translate3d(3%,2%,0) scale(1.08); } }
.app-shell, .gate-card{ position:relative; z-index:1; }

/* orbe liquide de l'assistant / mise à jour */
.ai-orb{
  width:84px; height:84px; border-radius:50%; position:relative;
  background:radial-gradient(circle at 32% 28%, #FFF0DE 0%, #FFB45C 34%, #FF7A00 68%, #B24A00 100%);
  box-shadow:0 12px 40px -6px rgba(255,122,0,.55), inset 0 -8px 18px rgba(120,40,0,.35), inset 0 6px 14px rgba(255,255,255,.55);
  animation:orbFloat 5s ease-in-out infinite;
}
.ai-orb::after{
  content:''; position:absolute; inset:-14px; border-radius:50%;
  border:1px solid rgba(255,122,0,.35); animation:orbRing 3.2s ease-out infinite;
}
@keyframes orbFloat{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-7px) } }
@keyframes orbRing{ from{ transform:scale(.85); opacity:.9 } to{ transform:scale(1.35); opacity:0 } }

/* entrée en cascade des cartes/KPI */
.app-panel.active .app-stat, .app-panel.active .app-card, .app-panel.active .app-list, .app-panel.active .rule-row{
  animation:riseIn .55s var(--ease-out) both;
}
.app-panel.active .app-stat:nth-child(2){ animation-delay:.06s } .app-panel.active .app-stat:nth-child(3){ animation-delay:.12s } .app-panel.active .app-stat:nth-child(4){ animation-delay:.18s }
.app-panel.active .app-card:nth-of-type(2){ animation-delay:.1s }
@keyframes riseIn{ from{ opacity:0; transform:translateY(16px) scale(.985) } to{ opacity:1; transform:none } }

/* survol "SaaS" */
.app-stat, .app-card, .app-row{ transition:transform .3s var(--ease-out), box-shadow .3s, border-color .3s, background .2s; }
.app-stat:hover{ transform:translateY(-3px); border-color:rgba(255,122,0,.35); box-shadow:0 18px 44px -18px rgba(255,122,0,.35); }
.app-row:hover{ transform:translateX(2px); }
.btn:active, .row-btn:active, .app-tabs button:active{ transform:scale(.97); }

/* chips de statut */
.chip{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:100px; font-size:11px; font-weight:600; border:1px solid var(--hairline); color:var(--text-2); background:var(--glass-1); }
.chip.ok{ color:#0E8F5B; border-color:rgba(22,184,120,.35); background:rgba(22,184,120,.10); }
.chip.mid{ color:#B86300; border-color:rgba(255,122,0,.35); background:rgba(255,122,0,.10); }
.chip.crit{ color:#C23434; border-color:rgba(233,75,75,.35); background:rgba(233,75,75,.10); }
body.app-body[data-theme="dark"] .chip.ok{ color:#5EE3AE } body.app-body[data-theme="dark"] .chip.mid{ color:#FFB45C } body.app-body[data-theme="dark"] .chip.crit{ color:#FF8A8A }

/* graphique rapports */
#repChart .bar{ fill:url(#repGrad); transform-origin:bottom; transform-box:fill-box; animation:barGrow .8s var(--ease-out) both; }
@keyframes barGrow{ from{ transform:scaleY(0) } to{ transform:scaleY(1) } }
#repChart text{ fill:var(--text-3); font-size:10px; font-family:'Martian Mono',monospace; }

/* assistant */
.ai-msg{ max-width:82%; padding:10px 14px; border-radius:16px; font-size:13px; line-height:1.55; animation:riseIn .35s var(--ease-out) both; }
.ai-msg.user{ align-self:flex-end; background:linear-gradient(90deg,var(--accent),var(--accent-2)); color:var(--on-accent); border-bottom-right-radius:4px; }
.ai-msg.bot{ align-self:flex-start; background:var(--glass-1); border:1px solid var(--hairline); color:var(--text-1); border-bottom-left-radius:4px; }
.ai-typing{ display:inline-flex; gap:4px; } .ai-typing i{ width:6px; height:6px; border-radius:50%; background:var(--accent); animation:dot 1s infinite; } .ai-typing i:nth-child(2){ animation-delay:.15s } .ai-typing i:nth-child(3){ animation-delay:.3s }
@keyframes dot{ 0%,80%,100%{ opacity:.25; transform:scale(.8) } 40%{ opacity:1; transform:scale(1.1) } }
[data-ai-suggest]:hover{ border-color:rgba(255,122,0,.45) !important; color:var(--text-1) !important; }

/* recherche globale */
.sr-group{ font-family:'Martian Mono',monospace; font-size:10.5px; letter-spacing:.08em; color:var(--text-3); margin:16px 0 8px; text-transform:uppercase; }
.sr-item{ display:flex; flex-direction:column; gap:2px; padding:11px 14px; border-radius:14px; border:1px solid var(--hairline-soft); background:var(--glass-1); margin-bottom:8px; cursor:pointer; transition:all .2s; }
.sr-item:hover{ border-color:rgba(255,122,0,.4); transform:translateX(3px); }
.sr-item b{ font-size:13.5px; font-weight:600; color:var(--text-1); } .sr-item span{ font-size:11.5px; color:var(--text-3); }

/* skeleton */
.skel{ position:relative; overflow:hidden; border-radius:14px; background:var(--hairline-soft); min-height:54px; margin-bottom:10px; }
.skel::after{ content:''; position:absolute; inset:0; background:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.55) 50%,transparent 80%); transform:translateX(-100%); animation:shimmer 1.4s infinite; }
@keyframes shimmer{ to{ transform:translateX(100%) } }

/* état hors connexion */
.net-pill{ position:fixed; left:50%; top:14px; transform:translateX(-50%); z-index:500; padding:8px 16px; border-radius:100px; font-size:12px; font-weight:600; color:#fff; background:#E94B4B; box-shadow:0 10px 30px -10px rgba(233,75,75,.6); animation:riseIn .4s var(--ease-out) both; }
.net-pill.ok{ background:#16B878; }

/* empty states */
.app-empty{ display:flex; flex-direction:column; align-items:center; gap:10px; }
.app-empty::before{ content:''; width:46px; height:46px; border-radius:50%; background:radial-gradient(circle at 32% 28%,#FFF0DE,#FFB45C 55%,#FF7A00); opacity:.85; box-shadow:0 10px 26px -8px rgba(255,122,0,.5); animation:orbFloat 4s ease-in-out infinite; }

/* bandeau mise à jour */
.update-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--accent); margin-left:6px; animation:orbRing 1.8s ease-out infinite; }

@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* ================= NAVIGATION MOBILE (barre basse, façon app) ================= */
.mobile-tabbar{ display:none; }
.quick-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:14px; }
.quick-grid button{
  display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 6px;
  border:1px solid var(--hairline); border-radius:16px; background:var(--glass-1); color:var(--text-2);
  font-size:11px; font-family:inherit; cursor:pointer; transition:all .2s var(--ease);
}
.quick-grid button i{ font-style:normal; font-size:19px; }
.quick-grid button:hover{ border-color:rgba(255,122,0,.4); color:var(--text-1); transform:translateY(-2px); }
.assist-cta{ margin-top:20px; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; background:linear-gradient(120deg,var(--accent-pale),var(--glass-2)); }
.sheet-panel{ border-radius:24px 24px 0 0 !important; }

@media (max-width:900px){
  .app-shell{ grid-template-columns:1fr; }
  .app-side{
    display:flex !important;
    position:fixed;
    left:0; top:0; bottom:0;
    width:min(86vw,300px);
    max-width:300px;
    height:100dvh;
    padding:18px 12px;
    transform:translateX(-105%);
    transition:transform .25s var(--ease-out);
    z-index:1000;
    overflow-y:auto;
    box-shadow:18px 0 60px rgba(0,0,0,.38);
  }
  .app-side.open{ transform:translateX(0); }
  .app-body-area{ padding-bottom:96px; }               /* laisse la place à la tabbar */
  .mobile-tabbar{
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:150;
    background:var(--glass-2); backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px);
    border-top:1px solid var(--hairline); padding:8px 4px calc(6px + env(safe-area-inset-bottom,0px));
  }
  .mobile-tabbar button{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding:6px 2px;
    border:0; background:none; color:var(--text-3); font-size:10.5px; font-family:inherit; cursor:pointer;
  }
  .mobile-tabbar button svg{ width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
  .mobile-tabbar button.active{ color:var(--accent); }
  .mobile-tabbar button.active svg{ filter:drop-shadow(0 0 6px rgba(255,122,0,.5)); }
  .app-drawer-panel.sheet-panel{ align-self:end; margin-top:auto; max-height:80vh; }
  .app-drawer#plusSheet{ grid-template-columns:1fr; align-items:end; }
  .app-drawer#plusSheet .app-drawer-panel{ width:100%; transform:translateY(100%); }
  .app-drawer#plusSheet.on .app-drawer-panel{ transform:none; }
  .quick-grid{ grid-template-columns:repeat(4,1fr); }
}

/* ================= ÉCRAN DE CONNEXION — split brand/form + orbe liquide ================= */
.gate{ min-height:100vh; padding:0; align-items:stretch; }
.gate-frame{ display:grid; grid-template-columns:1fr 1fr; min-height:100vh; width:100%; }

.gate-brand{
  position:relative; overflow:hidden; display:flex; align-items:center; justify-content:center; padding:60px 50px;
  background:radial-gradient(120% 100% at 15% 0%, rgba(255,122,0,.16), transparent 55%), #071A2F;
  color:#F8FBFF;
}
.gate-brand-inner{ max-width:420px; position:relative; z-index:2; }
.gate-brand .gate-logo b{ color:#F8FBFF; }
.gate-brand .gate-logo span{ color:#8CA0B6; }
.gate-orb-wrap{ margin:34px 0 30px; display:flex; }
.gate-brand-title{ font-size:clamp(26px,2.6vw,34px); font-weight:800; line-height:1.18; color:#F8FBFF; }
.gate-brand-title br{ display:block; }
.gate-brand-lead{ margin-top:16px; font-size:14px; line-height:1.7; color:#B9C6D6; max-width:40ch; }
.gate-brand-list{ list-style:none; margin:26px 0 0; padding:0; display:flex; flex-direction:column; gap:12px; }
.gate-brand-list li{ display:flex; align-items:center; gap:10px; font-size:13px; color:#DCE7F2; }
.gate-brand-list li i{ font-style:normal; width:20px; height:20px; border-radius:50%; background:rgba(255,122,0,.18); color:#FF9736; display:grid; place-items:center; font-size:11px; flex:none; }

.gate-form-side{ display:flex; align-items:center; justify-content:center; padding:40px 24px; background:var(--surf-page,var(--void)); overflow-y:auto; }
.gate-logo-mobile{ display:none; }

.gate-card{
  width:100%; max-width:420px; border:1px solid var(--glass-2-line); border-radius:28px;
  background:var(--glass-2); backdrop-filter:blur(32px); -webkit-backdrop-filter:blur(32px); padding:38px 34px;
  box-shadow:var(--shadow-frosted);
}

/* orbe liquide — réutilisé partout où on veut la "boule d'eau" de marque */
.gate-orb{
  width:92px; height:92px; border-radius:50%; position:relative;
  background:radial-gradient(circle at 30% 26%, #FFF6EA 0%, #FFD9A8 22%, #FF9736 52%, #FF7A00 74%, #B24A00 100%);
  box-shadow:0 16px 46px -8px rgba(255,122,0,.55), inset 0 -10px 20px rgba(110,35,0,.35), inset 0 8px 16px rgba(255,255,255,.55);
  animation:orbFloat 5s ease-in-out infinite;
}
.gate-orb::before{
  content:''; position:absolute; inset:10%; border-radius:50%;
  background:radial-gradient(circle at 62% 70%, rgba(85,200,245,.35), transparent 60%);
  mix-blend-mode:screen; animation:orbFloat 6.5s ease-in-out infinite reverse;
}
.gate-orb::after{ content:''; position:absolute; inset:-16px; border-radius:50%; border:1px solid rgba(255,151,54,.35); animation:orbRing 3.4s ease-out infinite; }

/* étapes d'inscription */
.gate-steps{ display:flex; align-items:center; gap:8px; margin:22px 0 24px; }
.gate-step{ display:flex; flex-direction:column; align-items:center; gap:5px; opacity:.5; transition:opacity .25s; }
.gate-step.active, .gate-step.done{ opacity:1; }
.gate-step i{
  width:26px; height:26px; border-radius:50%; display:grid; place-items:center; font-style:normal; font-size:11.5px; font-weight:700;
  border:1.5px solid var(--hairline); color:var(--text-2); background:var(--glass-1);
}
.gate-step.active i{ border-color:var(--accent); color:var(--accent); box-shadow:0 0 0 4px var(--accent-pale); }
.gate-step.done i{ background:linear-gradient(135deg,var(--accent),var(--accent-2)); border-color:transparent; color:#fff; }
.gate-step span{ font-size:9.5px; color:var(--text-3); font-family:'Martian Mono',monospace; letter-spacing:.02em; }
.gate-step-line{ flex:1; height:1px; background:var(--hairline); margin-bottom:16px; }
.gate-step-panel{ display:none; flex-direction:column; gap:14px; animation:riseIn .35s var(--ease-out) both; }
.gate-step-panel.active{ display:flex; }
.gate-row2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.gate-step-actions{ display:flex; align-items:center; gap:10px; margin-top:6px; }
.gate-check{ display:flex; align-items:flex-start; gap:9px; font-size:12px; color:var(--text-2); line-height:1.5; cursor:pointer; }
.gate-check input{ margin-top:3px; accent-color:var(--accent); flex:none; }
.gate-check a{ color:var(--accent); }

/* jauge de force du mot de passe */
.pwd-meter{ display:flex; gap:5px; margin-top:-6px; }
.pwd-meter i{ flex:1; height:4px; border-radius:3px; background:var(--hairline); transition:background .25s; }
.pwd-meter-label{ display:block; font-size:10.5px; color:var(--text-3); margin-top:2px; font-family:'Martian Mono',monospace; }
.pwd-meter.w1 i:nth-child(1){ background:var(--crit); }
.pwd-meter.w2 i:nth-child(-n+2){ background:#E08A00; }
.pwd-meter.w3 i:nth-child(-n+3){ background:var(--accent); }
.pwd-meter.w4 i{ background:var(--mint); }

/* bascule de thème "orbe" — même vocabulaire liquide sur les boutons ☀️/🌙/⚙️ */
.theme-switch{ background:var(--glass-1); }
.theme-switch button{ position:relative; }
.theme-switch button.active{ background:none; color:#fff; }
.theme-switch button.active::before{
  content:''; position:absolute; inset:0; border-radius:100px; z-index:-1;
  background:radial-gradient(circle at 30% 30%,#FFE8C9,#FF9736 55%,#FF7A00);
  box-shadow:0 6px 16px -4px rgba(255,122,0,.55), inset 0 -4px 8px rgba(120,40,0,.3), inset 0 3px 6px rgba(255,255,255,.5);
}

@media (max-width:980px){
  .gate-frame{ grid-template-columns:1fr; }
  .gate-brand{ display:none; }
  .gate-logo-mobile{ display:flex; }
  .gate-form-side{ padding:32px 18px; min-height:100vh; }
}

/* La tabbar mobile ne doit apparaître qu'une fois connecté (jamais derrière l'écran de connexion) */
.gate:not(.app-hidden) ~ .mobile-tabbar{ display:none !important; }


/* ============================================================
   FAXTRIX MOBILE NATIVE — disposition inspirée de la maquette
   Uniquement pour l'app Android/les petits écrans.
   L'espace web desktop conserve sa navigation existante.
   ============================================================ */
.mobile-services-panel{ display:none; }
.mobile-sheet-sub{ color:var(--text-2); font-size:12px; line-height:1.55; margin:-7px 0 16px; }
.mobile-service-hero{
  position:relative; overflow:hidden; min-height:154px; padding:20px; margin-bottom:16px;
  border:1px solid var(--glass-2-line); border-radius:24px;
  background:
    radial-gradient(circle at 88% 35%, rgba(85,200,245,.25), transparent 32%),
    radial-gradient(circle at 70% 100%, rgba(255,122,0,.15), transparent 42%),
    linear-gradient(135deg,var(--glass-2),rgba(223,247,255,.55));
  box-shadow:var(--shadow-card);
}
.mobile-service-hero > div:first-child{ position:relative; z-index:2; max-width:78%; }
.mobile-service-hero .eyebrow{ font-family:'Martian Mono',monospace; font-size:9px; letter-spacing:.12em; color:var(--accent); font-weight:600; }
.mobile-service-hero h3{ font-size:19px; line-height:1.18; margin:8px 0 7px; color:var(--text-1); }
.mobile-service-hero p{ font-size:11.5px; line-height:1.55; color:var(--text-2); }
.mobile-service-orb{
  position:absolute; width:105px; height:105px; right:-20px; bottom:-30px; border-radius:50%;
  background:radial-gradient(circle at 30% 25%,#fff7eb,#ffd8a4 25%,#ff9736 56%,#ff7a00 78%,#a94900);
  box-shadow:inset 0 7px 14px rgba(255,255,255,.65),inset 0 -12px 22px rgba(100,30,0,.35),0 18px 42px rgba(255,122,0,.22);
}
.mobile-service-orb::before{ content:''; position:absolute; inset:15%; border-radius:50%; border:1px solid rgba(255,255,255,.55); }
.service-cards{ display:grid; gap:10px; }
.service-card{
  width:100%; display:grid; grid-template-columns:42px 1fr 20px; align-items:center; gap:10px; text-align:left;
  border:1px solid var(--glass-2-line); border-radius:18px; padding:13px 12px;
  background:var(--glass-1); color:var(--text-1); box-shadow:var(--shadow-card); cursor:pointer;
  transition:transform .2s var(--ease),border-color .2s,background .2s;
}
.service-card:active{ transform:scale(.985); }
.service-card:hover{ border-color:rgba(255,122,0,.35); }
.service-card > span:nth-child(2){ min-width:0; }
.service-card b{ display:block; font-size:12.5px; line-height:1.25; }
.service-card small{ display:block; color:var(--text-3); font-size:10.5px; line-height:1.35; margin-top:4px; }
.service-card > strong{ font-size:22px; line-height:1; color:var(--text-3); font-weight:400; text-align:center; }
.service-icon{
  width:42px; height:42px; display:grid; place-items:center; border-radius:14px; font-size:19px; font-weight:700;
  border:1px solid var(--hairline); background:var(--glass-2);
}
.service-icon.orange{ color:#ff7a00; background:rgba(255,122,0,.11); }
.service-icon.aqua{ color:#168ab4; background:rgba(85,200,245,.12); }
.service-icon.blue{ color:#527fc0; background:rgba(82,127,192,.11); }
.service-icon.red{ color:#d34c4c; background:rgba(211,76,76,.10); }
.service-icon.violet{ color:#805ec7; background:rgba(128,94,199,.11); }
.service-icon.green{ color:#15966b; background:rgba(21,150,107,.10); }
.mobile-service-footer{ margin-top:14px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px; }
.mobile-service-footer > div{ display:flex; flex-direction:column; gap:3px; }
.mobile-service-footer b{ font-size:12.5px; }
.mobile-service-footer span{ font-size:10.5px; color:var(--text-2); }

@media (max-width:900px){
  html.faxtrix-native body.app-body{ overflow-x:hidden; }
  html.faxtrix-native body .app-body-area{ padding:16px 14px 96px; }
  html.faxtrix-native body .app-top{ min-height:62px; padding:10px 14px; }
  html.faxtrix-native body .app-top h2{ font-size:17px; }
  html.faxtrix-native body .app-top .sub{ font-size:10.5px; max-width:230px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  html.faxtrix-native body .app-top-actions{ gap:7px; }
  html.faxtrix-native body .app-icon-btn{ width:34px; height:34px; }
  html.faxtrix-native body .app-user{ padding:3px; border:0; background:none; }
  html.faxtrix-native body .app-user-av{ width:32px; height:32px; }
  html.faxtrix-native body .demo-banner{ margin-bottom:14px; border-radius:14px; padding:10px 12px; font-size:10.5px; }
  html.faxtrix-native body .app-stats{ gap:9px; margin-bottom:14px; }
  html.faxtrix-native body .app-stat{ min-height:75px; padding:13px 12px; border-radius:17px; }
  html.faxtrix-native body .app-stat b{ font-size:22px; }
  html.faxtrix-native body .app-stat span{ font-size:8.5px; line-height:1.25; }
  html.faxtrix-native body .app-card{ border-radius:19px; padding:16px; }
  html.faxtrix-native body .app-card h3{ font-size:14px; margin-bottom:12px; }
  html.faxtrix-native body .quick-grid{ gap:8px; }
  html.faxtrix-native body .quick-grid button{ border-radius:14px; padding:11px 5px; font-size:9.5px; }
  html.faxtrix-native body .quick-grid button i{ font-size:17px; }
  html.faxtrix-native body .assist-cta{ margin-top:14px; }
  html.faxtrix-native body .mobile-tabbar{
    padding:7px 6px calc(6px + env(safe-area-inset-bottom,0px));
    border-top-left-radius:18px; border-top-right-radius:18px;
    box-shadow:0 -10px 35px rgba(30,100,140,.09);
  }
  html.faxtrix-native body .mobile-tabbar button{ min-width:0; font-size:9.5px; }
  html.faxtrix-native body .mobile-tabbar button svg{ width:20px; height:20px; }
  html.faxtrix-native body .mobile-tabbar button.active{ font-weight:700; }
  html.faxtrix-native body .mobile-services-panel{ display:block; }
  html.faxtrix-native body .mobile-services-panel:not(.active){ display:none; }
  html.faxtrix-native body .service-cards{ grid-template-columns:1fr; }
  html.faxtrix-native body .mobile-service-hero{ min-height:145px; }
  html.faxtrix-native body .mobile-service-hero h3{ font-size:18px; }
  html.faxtrix-native body .mobile-service-footer{ flex-direction:column; align-items:stretch; }
  html.faxtrix-native body .mobile-service-footer .btn{ width:100%; }
  html.faxtrix-native body .service-grid{ grid-template-columns:repeat(2,1fr); }
  html.faxtrix-native body .service-grid button{ min-height:82px; }
}

.faxtrix-native .gate{ padding-bottom:env(safe-area-inset-bottom,0px); }
.faxtrix-native .app-body-area{ padding-bottom:calc(96px + env(safe-area-inset-bottom,0px)); }
.faxtrix-native .mobile-tabbar{ padding-bottom:calc(7px + env(safe-area-inset-bottom,0px)); }

/* La nouvelle barre native n'intervient jamais dans l'espace web. */
.mobile-tabbar-native{ display:none !important; }
@media (max-width:900px){
  html.faxtrix-native body .mobile-tabbar-native{ display:flex !important; }
  html.faxtrix-native body .mobile-tabbar-web{ display:none !important; }
}


/* Inventaire détaillé + messagerie FAXTRIX */
.app-row[data-record-view]{cursor:pointer;transition:transform .16s ease,border-color .16s ease}
.app-row[data-record-view]:hover{transform:translateY(-1px);border-color:rgba(0,196,255,.35)}
.app-modal{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:20px}
.app-modal[hidden]{display:none}
.app-modal-bg{position:absolute;inset:0;background:rgba(2,10,20,.76);backdrop-filter:blur(8px)}
.app-modal-card{position:relative;width:min(760px,96vw);max-height:88vh;overflow:auto;background:var(--panel,#0a1a2c);border:1px solid var(--line-soft);border-radius:20px;box-shadow:0 24px 80px rgba(0,0,0,.38);padding:22px}
.record-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:18px}
.record-detail-item{padding:13px;border:1px solid var(--line-soft);border-radius:12px;background:rgba(255,255,255,.025)}
.record-detail-item.full{grid-column:1/-1}
.record-detail-item small{display:block;color:var(--slate-2);font-size:10px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:5px}
.record-detail-item b,.record-detail-item span{word-break:break-word}
.chat-layout{display:grid;grid-template-columns:300px minmax(0,1fr);height:620px;margin-top:18px;border:1px solid var(--line-soft);border-radius:18px;overflow:hidden;background:rgba(255,255,255,.02)}
.chat-sidebar{border-right:1px solid var(--line-soft);padding:12px;overflow:auto}
.chat-conversations{margin-top:10px;display:grid;gap:5px}
.chat-conv{width:100%;display:flex;align-items:center;gap:10px;text-align:left;border:0;background:transparent;color:inherit;padding:10px;border-radius:12px;cursor:pointer}
.chat-conv:hover,.chat-conv.active{background:rgba(0,196,255,.09)}
.chat-avatar{width:38px;height:38px;min-width:38px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,rgba(0,196,255,.3),rgba(75,82,255,.35));overflow:hidden;font-weight:700}
.chat-avatar img{width:100%;height:100%;object-fit:cover}
.chat-conv-text{min-width:0;display:grid;gap:3px}.chat-conv-text b,.chat-conv-text span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-conv-text span{font-size:11px;color:var(--slate-2)}
.chat-main{min-width:0;display:flex;flex-direction:column}
.chat-head{display:flex;justify-content:space-between;align-items:center;padding:12px 15px;border-bottom:1px solid var(--line-soft)}
.chat-person{display:flex;align-items:center;gap:10px}.chat-person>div:last-child{display:grid;gap:3px}.chat-person span{font-size:11px;color:var(--slate-2)}
.chat-head-actions{display:flex;gap:6px}
.chat-messages{flex:1;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:8px}
.chat-bubble{max-width:min(78%,620px);padding:9px 11px;border-radius:14px;border:1px solid var(--line-soft);background:rgba(255,255,255,.04)}
.chat-bubble.mine{align-self:flex-end;background:rgba(0,196,255,.11);border-color:rgba(0,196,255,.2)}
.chat-bubble .chat-meta{font-size:10px;color:var(--slate-2);margin-top:5px}
.chat-file{display:flex;align-items:center;gap:8px;padding:8px;border-radius:9px;background:rgba(255,255,255,.05);margin-bottom:5px}
.chat-compose{display:flex;align-items:center;gap:7px;padding:11px;border-top:1px solid var(--line-soft)}
.chat-compose input[type=text]{flex:1;min-width:0}.chat-attachment{padding:7px 12px;border-top:1px solid var(--line-soft);font-size:12px;color:var(--slate)}
.chat-attachment{display:flex;justify-content:space-between;align-items:center}
.chat-empty{display:grid;place-items:center;height:100%;color:var(--slate-2);padding:30px;text-align:center}
.chat-new-list{display:grid;gap:7px;max-height:300px;overflow:auto;margin:10px 0}
.chat-member-option{display:flex;align-items:center;gap:8px;padding:8px;border:1px solid var(--line-soft);border-radius:10px}
.call-videos{position:relative;min-height:360px;background:#02070d;border-radius:15px;overflow:hidden;display:grid;place-items:center}
.call-videos video:first-child{width:100%;height:360px;object-fit:cover}.call-videos video:last-child{position:absolute;width:150px;height:105px;right:12px;bottom:12px;object-fit:cover;border-radius:10px;border:1px solid rgba(255,255,255,.2)}
.call-actions{display:flex;justify-content:center;gap:8px;margin-top:14px;flex-wrap:wrap}
@media(max-width:900px){.chat-layout{grid-template-columns:1fr;height:calc(100vh - 250px)}.chat-sidebar{max-height:190px;border-right:0;border-bottom:1px solid var(--line-soft)}.record-detail-grid{grid-template-columns:1fr}.record-detail-item.full{grid-column:auto}}

/* ================= MESSAGERIE — mobile + recherche membres ================= */
.faxtrix-chat-overlay{
  position:fixed !important; inset:0 !important; z-index:2147483000 !important;
  display:flex !important; align-items:center !important; justify-content:center !important;
  width:100vw !important; height:100dvh !important; box-sizing:border-box !important;
  padding:16px !important; margin:0 !important;
  background:rgba(3,10,20,.82) !important;
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
}
.faxtrix-chat-overlay *{box-sizing:border-box}
.faxtrix-chat-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0 10px}
.faxtrix-chat-toolbar .faxtrix-chat-status{margin:0}
.faxtrix-chat-dialog .btn:disabled{opacity:.55;cursor:wait}
.faxtrix-chat-dialog{
  width:min(620px,100%);max-height:min(760px,90vh);overflow:auto;
  padding:22px;border:1px solid var(--glass-2-line);border-radius:22px;
  background:var(--glass-2);color:var(--text-1);box-shadow:0 24px 80px rgba(0,0,0,.45);
}
.faxtrix-chat-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.faxtrix-chat-dialog-head h3{margin:5px 0 4px;color:var(--text-1)}
.faxtrix-chat-dialog-head p{margin:0;color:var(--text-2);font-size:12px}
.faxtrix-chat-person-search{display:flex;gap:8px;align-items:center;margin:18px 0 10px}
.faxtrix-chat-person-search .app-search{flex:1}
.faxtrix-chat-status{font-size:12px;color:var(--text-2);margin:8px 0 10px}
.faxtrix-chat-people{display:grid;gap:8px}
.faxtrix-chat-person-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 12px;border:1px solid var(--hairline);border-radius:14px;background:var(--glass-1);
}
.faxtrix-chat-person-info{display:flex;align-items:center;gap:10px;min-width:0}
.faxtrix-chat-person-info>span:last-child{display:grid;gap:3px;min-width:0}
.faxtrix-chat-person-info b{color:var(--text-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.faxtrix-chat-person-info small{color:var(--text-2);font-size:11px}
.faxtrix-chat-talk{white-space:nowrap;flex:none}
@media(max-width:900px){
  .faxtrix-chat-overlay{padding:10px !important;align-items:flex-end !important}
  .faxtrix-chat-dialog{width:min(100%,680px);max-height:92dvh;border-radius:20px 20px 0 0;padding:16px}
  .faxtrix-chat-person-search{flex-direction:column;align-items:stretch}
  .faxtrix-chat-person-search .btn{width:100%}
  .faxtrix-chat-person-row{padding:10px}
  .faxtrix-chat-talk{padding:9px 11px}
  .chat-layout{height:calc(100dvh - 250px);min-height:420px}
  .chat-compose{padding:9px;gap:5px}
  .chat-compose .btn{padding:9px 12px}
  .chat-head{padding:10px}
  .chat-messages{padding:12px}
}
@media(max-width:520px){
  .app-body-area{padding:12px}
  .faxtrix-chat-dialog{padding:14px;border-radius:18px 18px 0 0}
  .faxtrix-chat-dialog-head h3{font-size:18px}
  .faxtrix-chat-dialog-head p{font-size:11px}
  .faxtrix-chat-person-search{margin:12px 0 8px}
  .faxtrix-chat-person-row{gap:8px;padding:9px}
  .faxtrix-chat-person-info{min-width:0}
  .faxtrix-chat-person-info b{max-width:150px}
  .faxtrix-chat-toolbar .btn{padding:8px 10px;font-size:11px}
  .app-card{padding:14px;border-radius:18px}
  .app-card-head{align-items:flex-start}
  #chatNewBtn{width:100%}
  .faxtrix-chat-person-row{align-items:center}
  .faxtrix-chat-talk{font-size:11px}
  .chat-compose input[type=text]{font-size:14px}
  .chat-bubble{max-width:88%}
}

/* Correctifs Android / petits écrans : aucun panneau ne doit dépasser la largeur de l'écran. */
@media(max-width:900px){
  html,body{max-width:100%;overflow-x:hidden;}
  .app-top{min-width:0;}
  .app-top>div:first-child{min-width:0;}
  .app-top-actions{min-width:0;}
  .app-top .sub{max-width:42vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .app-card-head{gap:10px;flex-wrap:wrap;}
  .app-card-head>div{min-width:0;flex:1 1 220px;}
  .chat-layout{width:100%;max-width:100%;height:calc(100dvh - 235px);min-height:430px;}
  .chat-sidebar{min-width:0;max-height:180px;}
  .chat-main{min-width:0;min-height:0;}
  .chat-compose{flex-wrap:nowrap;}
  .chat-compose input[type=text]{min-width:0;width:100%;}
  .faxtrix-chat-overlay{overflow:hidden;}
  .faxtrix-chat-dialog{width:100%;max-width:100%;min-width:0;}
  .faxtrix-chat-person-row{min-width:0;}
}
@media(max-width:520px){
  .app-body-area{padding:12px 10px 92px;}
  .app-top{padding:10px 12px;}
  .app-top h2{font-size:17px;}
  .app-top .sub{max-width:36vw;font-size:10px;}
  .app-icon-btn{width:34px;height:34px;}
  .app-top-actions{gap:6px;}
  .app-user{max-width:42px;}
  .chat-layout{height:calc(100dvh - 205px);min-height:420px;}
  .chat-compose{gap:4px;}
  .chat-compose .row-btn{flex:0 0 34px;}
  .chat-compose .btn{flex:0 0 auto;padding:9px 10px;}
  .chat-bubble{max-width:90%;word-break:break-word;}
  .faxtrix-chat-dialog-head{gap:8px;}
  .faxtrix-chat-person-row{align-items:center;}
  .faxtrix-chat-person-info{flex:1;min-width:0;}
  .faxtrix-chat-talk{flex:0 0 auto;}
}

/* Menu mobile FAXTRIX */
.mobile-menu-btn{display:none !important;font-size:18px !important}
@media(max-width:900px){.mobile-menu-btn{display:grid !important}.app-side{box-shadow:18px 0 60px rgba(0,0,0,.35)}.app-top{z-index:140}.app-side{z-index:150}}

/* ================= Correctif mobile Android / FAXTRIX final ================= */
@media (max-width:900px){
  body.app-body{width:100%;min-width:0;overflow-x:hidden;}
  .app-shell{width:100%;min-width:0;}
  .app-main{width:100%;min-width:0;}
  .app-side{
    width:min(82vw,300px);
    max-width:300px;
    height:100dvh;
    max-height:100dvh;
    overflow-y:auto;
    overflow-x:hidden;
    padding:16px 12px;
    z-index:1000;
  }
  .app-side.open{box-shadow:18px 0 60px rgba(0,0,0,.45);}
  .app-top{width:100%;min-width:0;position:sticky;top:0;z-index:900;}
  .app-top-actions{gap:6px;min-width:0;}
  .app-user{min-width:0;max-width:120px;}
  .app-user span{max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .app-body-area{width:100%;min-width:0;padding:14px 12px 88px;}
  .app-card,.app-list,.app-grid2,.app-stats{min-width:0;max-width:100%;}
  .app-stats{gap:10px;}
  .app-stat{padding:14px;}
  .app-toolbar{align-items:stretch;}
  .app-toolbar>.app-search{min-width:100%;order:3;}
  .app-row{flex-wrap:wrap;padding:13px 12px;}
  .app-row .r-main{min-width:calc(100% - 10px);}
  .app-row-actions{margin-left:auto;}
  .chat-layout{display:flex;flex-direction:column;width:100%;height:calc(100dvh - 220px);min-height:430px;margin-top:12px;}
  .chat-sidebar{width:100%;max-height:150px;flex:0 0 auto;border-right:0;border-bottom:1px solid var(--line-soft);}
  .chat-main{width:100%;min-height:0;flex:1;}
  .chat-messages{min-height:0;}
  .chat-compose{width:100%;padding:8px;flex-wrap:nowrap;}
  .chat-compose input[type=text]{min-width:0;flex:1;}
  .chat-compose .btn{white-space:nowrap;}
}
@media (max-width:520px){
  .app-top{padding:10px;}
  .app-top h2{font-size:16px;}
  .app-top .sub{font-size:10px;max-width:34vw;}
  .app-icon-btn{width:34px;height:34px;}
  .app-user{padding-right:6px;}
  .app-body-area{padding:10px 9px 92px;}
  .app-card{padding:14px;border-radius:18px;}
  .app-card-head{gap:10px;align-items:flex-start;}
  .app-card-head>div{min-width:0;}
  .app-card-head #chatNewBtn{width:100%;}
  .chat-layout{height:calc(100dvh - 200px);min-height:420px;}
  .chat-sidebar{max-height:125px;padding:8px;}
  .chat-compose .row-btn{flex:0 0 34px;}
  .chat-compose .btn{padding:9px 10px;}
  .faxtrix-chat-overlay{padding:0 !important;align-items:flex-end !important;}
  .faxtrix-chat-dialog{width:100% !important;max-width:none !important;max-height:94dvh !important;border-radius:20px 20px 0 0 !important;padding:14px !important;}
  .faxtrix-chat-person-search{display:grid !important;grid-template-columns:minmax(0,1fr) auto !important;gap:7px !important;}
  .faxtrix-chat-person-search .btn{width:auto !important;}
  .faxtrix-chat-person-row{padding:9px !important;}
  .faxtrix-chat-person-info b{max-width:42vw;}
}

/* FAXTRIX — messagerie et administration mobile finale */
.faxtrix-chat-overlay{z-index:3000;}
.faxtrix-chat-dialog{box-sizing:border-box;overflow:hidden;}
.faxtrix-chat-people{max-height:min(48vh,420px);overflow:auto;}
.faxtrix-chat-person-row{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
.faxtrix-chat-person-info{display:flex;align-items:center;gap:10px;min-width:0;flex:1;}
.faxtrix-chat-person-info span:last-child{min-width:0;}
.faxtrix-chat-person-info b,.faxtrix-chat-person-info small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.credential-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;}
.credential-grid>div{min-width:0;padding:10px;border:1px solid var(--line-soft);border-radius:12px;}
.credential-grid b,.credential-grid span,.credential-grid code{display:block;overflow-wrap:anywhere;}
@media(max-width:900px){.credential-grid{grid-template-columns:1fr;}.faxtrix-chat-dialog{max-height:90dvh;overflow:auto;}.faxtrix-chat-people{max-height:48dvh;}}
@media(max-width:520px){.faxtrix-chat-dialog{padding:12px!important;}.faxtrix-chat-person-search{grid-template-columns:1fr!important;}.faxtrix-chat-person-search .btn{width:100%!important;}.faxtrix-chat-person-row{align-items:flex-start;}.faxtrix-chat-talk{width:100%;margin-left:48px;}}


/* FAXTRIX — gestion utilisateurs + menu mobile final */
.invite-link{display:inline-block;margin-top:7px;color:var(--ion,#59c7ff);font-size:11px;text-decoration:none;overflow-wrap:anywhere}
.invite-link:hover{text-decoration:underline}
#teamCard .contact-form{gap:10px}
#teamCard .contact-form label{display:grid;gap:6px}
#teamCard .contact-form input,#teamCard .contact-form select{width:100%}
@media(max-width:900px){
  body:has(.app-side.open)::after{
    content:"";position:fixed;inset:0;z-index:999;background:rgba(2,9,18,.68);
    backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);
  }
  html.faxtrix-native body .app-side.open{z-index:1001}
  html.faxtrix-native body .app-top{z-index:900}
  html.faxtrix-native body .app-main{min-width:0;width:100%}
  html.faxtrix-native body .app-body-area{overflow-x:hidden}
  #teamCard{width:100%;max-width:none!important}
  #teamCard .app-card-head{flex-wrap:wrap}
}
@media(max-width:520px){
  #teamCard .app-card-head>div{flex-basis:100%}
  #teamCard .btn{width:100%}
  .invite-link{font-size:10.5px}
}


/* FAXTRIX — tableau de bord réel */
.home-data-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}
.home-data-card{min-width:0;padding:14px;border:1px solid var(--line-soft);border-radius:16px;background:rgba(255,255,255,.025)}
.home-data-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.home-data-head>div{display:grid;gap:3px;min-width:0}
.home-data-head b{font-size:13px}
.home-data-head span{font-size:10px;color:var(--text-2)}
.home-data-head strong{font-size:22px}
.home-bars{height:116px;display:flex;align-items:flex-end;gap:7px;padding:12px 4px 2px}
.home-bar-wrap{height:100%;flex:1;min-width:0;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:3px}
.home-bar-wrap small{font-size:9px;color:var(--text-2);white-space:nowrap}
.home-bar-value{font-size:9px;color:var(--text-2);min-height:11px}
.home-bar{display:block;width:min(22px,72%);min-height:4px;border-radius:7px 7px 3px 3px;background:linear-gradient(180deg,var(--ion),rgba(0,196,255,.16));box-shadow:0 0 14px rgba(0,196,255,.13)}
.home-legend{display:flex;justify-content:space-between;gap:8px;padding-top:9px;border-top:1px solid var(--line-soft);font-size:10px;color:var(--text-2)}
.home-legend span:first-child{display:flex;align-items:center;gap:5px}
.home-legend i{width:7px;height:7px;border-radius:50%;display:inline-block;background:var(--ion)}
.home-legend b{color:var(--text-1)}
.mission-alert-overlay{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:18px;background:rgba(2,8,17,.76);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.mission-alert-overlay[hidden]{display:none!important}
.mission-alert-backdrop{position:absolute;inset:0}
.mission-alert-card{position:relative;width:min(620px,100%);display:flex;gap:18px;padding:24px;border:1px solid rgba(255,138,24,.32);border-radius:24px;background:linear-gradient(145deg,rgba(27,39,55,.98),rgba(11,24,40,.98));box-shadow:0 28px 100px rgba(0,0,0,.5)}
.mission-alert-icon{width:54px;height:54px;min-width:54px;border-radius:17px;display:grid;place-items:center;background:rgba(255,138,24,.13);font-size:25px}
.mission-alert-content{min-width:0;flex:1}
.mission-alert-content .eyebrow{font-size:10px;color:var(--orange,#ff8a18);font-weight:800;letter-spacing:.13em}
.mission-alert-content h3{margin:5px 0 7px;font-size:21px}
.mission-alert-content>p{margin:0;color:var(--text-2);font-size:12.5px;line-height:1.5}
.mission-alert-list{display:grid;gap:7px;margin-top:14px;max-height:230px;overflow:auto}
.mission-alert-item{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--line-soft);border-radius:12px;background:rgba(255,255,255,.035)}
.mission-alert-item b{font-size:12px;line-height:1.4}
.mission-alert-item span{font-size:10px;color:var(--text-2);white-space:nowrap}
.mission-alert-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
@media(max-width:1100px){.home-data-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.home-data-grid{grid-template-columns:1fr}.mission-alert-card{padding:18px;gap:12px}.mission-alert-icon{width:44px;height:44px;min-width:44px}.mission-alert-actions{flex-direction:column}.mission-alert-actions .btn{width:100%}.mission-alert-item{display:grid;gap:4px}}

/* ================= FAXTRIX — centre de contrôle 2026-10-02 ================= */
.crm-account-note,.ticket-export-note{display:flex;gap:10px;align-items:flex-start;margin:12px 0;padding:13px 15px;border:1px solid var(--line-soft);border-radius:14px;background:rgba(255,255,255,.025)}
.crm-account-note b{display:block;color:var(--text-1)}.crm-account-note span,.ticket-export-note span{font-size:11.5px;color:var(--text-2);line-height:1.55}
.analytics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:18px}
.analytics-card{min-width:0;padding:18px;border:1px solid var(--line-soft);border-radius:20px;background:linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.018));overflow:hidden}
.analytics-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}.analytics-head>div{display:grid;gap:4px}.analytics-head b{font-size:14px}.analytics-head span{font-size:10px;color:var(--text-2)}.analytics-head strong{font-size:22px;color:var(--ion)}
.analytics-card svg{width:100%;height:230px;overflow:visible;color:var(--text-2)}.analytics-card svg text{font-size:10px;fill:currentColor}.analytics-card svg path,.analytics-card svg circle{filter:drop-shadow(0 0 5px rgba(255,138,24,.18))}
.intelligence-hero{background:radial-gradient(circle at 85% 20%,rgba(255,138,24,.12),transparent 35%),linear-gradient(145deg,rgba(255,255,255,.05),rgba(255,255,255,.02))}
.simulation-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:20px}.simulation-grid .sim-result{grid-column:1/-1}.simulation-advice{margin-top:16px;padding:14px;border:1px solid var(--line-soft);border-radius:13px;color:var(--text-2);font-size:12px;background:rgba(255,255,255,.025)}
.messaging-fallback-card{max-width:900px;margin:0 auto}.messaging-fallback-card .contact-form{gap:14px}
.reports-export-toolbar{align-items:center}.report-export-actions{display:flex;gap:7px;flex-wrap:wrap;margin-left:auto}.report-export-actions .btn{white-space:nowrap}
.ticket-files-box{margin:14px 0;padding:13px;border:1px solid var(--line-soft);border-radius:14px;background:rgba(255,255,255,.025)}.ticket-files-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:9px}.ticket-files-head span{font-size:10.5px;color:var(--text-2)}.ticket-files-list{display:grid;gap:7px;margin-top:10px}.ticket-file-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line-soft);border-radius:10px;background:rgba(255,255,255,.025)}.ticket-file-row>span{min-width:0;display:grid;gap:2px}.ticket-file-row b{font-size:11.5px;overflow-wrap:anywhere}.ticket-file-row small{font-size:9.5px;color:var(--text-2)}.ticket-file-row .row-btn{flex:none}
@media(max-width:900px){.analytics-grid{grid-template-columns:1fr}.simulation-grid{grid-template-columns:1fr}.simulation-grid .sim-result{grid-column:auto}.report-export-actions{margin-left:0;width:100%}.report-export-actions .btn{flex:1}.ticket-files-head{display:grid}.quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.report-export-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.report-export-actions .btn{width:100%}.analytics-card{padding:14px}.analytics-card svg{height:190px}.ticket-file-row{align-items:flex-start}}
@media print{
  .app-side,.app-top,.report-export-actions,.app-toolbar,.demo-banner,.toast-wrap{display:none!important}
  .app-body-area{padding:0!important}.app-main{width:100%!important}.app-panel{display:none!important}.app-panel.active{display:block!important}
  .app-card,.analytics-card{box-shadow:none!important;border:1px solid #ddd!important;background:#fff!important;color:#111!important}
}
