/* Plateforme Ligne1 — console SophIA.
   SYSTÈME PARTAGÉ (B1) : la console parle désormais le langage du Signal.
   - Typographie : Fraunces (affichage) + Inter (texte), déclarées en
     @font-face dans accueil.css — les deux feuilles sont toujours chargées
     ensemble par index.html ; repli Georgia/system-ui si l'une manque.
   - Structure commune : rayons (carte 20 px, champ 12 px), anneau de focus
     (bordure accent + halo 3 px à 25 %, outline 2 px en :focus-visible),
     rythme d'espacement 4/8.
   - Les 6 thèmes ne portent plus que des rampes de couleurs : identité
     claire/sombre et persistance inchangées. Le thème noir/bleu reprend la
     palette exacte de la porte (--s-* du Signal : fond #05080f, carte
     #0b1322, texte #edf2fd, doux #9db0d0, accent #3b9eff).
   - C2 : --ok/--danger et les accents sont thématisés dans les rampes
     claires (états mesurés ≥ 4,5:1), et --border-champ donne aux champs
     une bordure ≥ 3:1 sur fond et surface dans les 6 thèmes (les champs
     ont le même fond que leurs cartes : la bordure est leur seule
     identification visuelle, WCAG 1.4.11). Contrastes prouvés par
     contrastes.py (matrice complète avant/après). */
*{box-sizing:border-box}
:root{
  --font-display:"Fraunces",Georgia,"Times New Roman",serif;
  --font-texte:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --bg:#08080a; --surface:#0e0e11; --surface-2:#17171b; --border:#232329;
  --text:#f4f4f6; --muted:#8b8b93; --accent:#3b9eff; --on-accent:#04101f;
  --danger:#ff8f93; --ok:#2fd08c; --radius:16px; --radius-champ:12px;
  --border-champ:#63636d;
}
html[data-theme="blancbleu"]{--bg:#f2f5fb;--surface:#e9eff9;--surface-2:#dde7f6;--border:#c9d6ee;--text:#131a26;--muted:#5b6a80;--accent:#1a46c2;--on-accent:#ffffff;--ok:#076b38;--danger:#b42318;--border-champ:#6e82a8}
html[data-theme="blancvert"]{--bg:#f2f7f4;--surface:#e7f2ec;--surface-2:#d9ebe1;--border:#c2ddd0;--text:#12211a;--muted:#5a6f64;--accent:#076e3f;--on-accent:#ffffff;--ok:#076b38;--danger:#b42318;--border-champ:#64826f}
html[data-theme="blancneon"]{--bg:#fbf3f7;--surface:#f7e8f0;--surface-2:#f2d9e7;--border:#eccbdd;--text:#241219;--muted:#7a5a6c;--accent:#ad0d72;--on-accent:#ffffff;--ok:#076b38;--danger:#b01e1e;--border-champ:#8a657d}
html[data-theme="noirbleu"]{--bg:#08080a;--surface:#0e0e11;--surface-2:#17171b;--border:#232329;--text:#f4f4f6;--muted:#8b8b93;--accent:#3b9eff;--on-accent:#04101f;--danger:#ff8f93;--border-champ:#63636d}
html[data-theme="noirvert"]{--bg:#08120d;--surface:#0f1f16;--surface-2:#14301f;--border:#1e3a2b;--text:#e6f5ec;--muted:#8fb3a1;--accent:#2fd08c;--on-accent:#03130b;--danger:#f26368;--border-champ:#5c8268}
html[data-theme="noirneon"]{--bg:#08080a;--surface:#150d13;--surface-2:#1f1219;--border:#33202c;--text:#f7e9f2;--muted:#b08fa5;--accent:#f43fb0;--on-accent:#1c0513;--border-champ:#86617a}
html{background:var(--bg)}
body{margin:0;font-family:var(--font-texte);background:var(--bg);color:var(--text);min-height:100vh;-webkit-font-smoothing:antialiased}
::selection{background:color-mix(in srgb,var(--accent) 35%,transparent)}
a{color:var(--accent)}
button{font:inherit;cursor:pointer}
input,select,textarea{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border-champ);border-radius:var(--radius-champ);padding:10px 12px;width:100%}
textarea{resize:vertical;min-height:44px}
/* Focus aligné sur la porte : bordure accent + halo, anneau en :focus-visible */
input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 25%,transparent)}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
label{display:block;font-size:.85rem;color:var(--muted);margin:12px 0 6px}
.btn{background:var(--accent);color:var(--on-accent);border:none;border-radius:var(--radius-champ);padding:11px 18px;font-weight:600;transition:filter .16s ease,background .16s ease}
.btn:hover{filter:brightness(1.07)}
.btn.secondary{background:var(--surface-2);color:var(--text);border:1px solid var(--border)}
.btn.danger{background:transparent;color:var(--danger);border:1px solid var(--danger)}
.btn.small{padding:7px 12px;font-size:.9rem}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;margin:16px 0}
.muted{color:var(--muted)}
.center-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.login-card{width:100%;max-width:400px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:32px}
.login-card h1{margin:0 0 4px;font-size:1.5rem;font-family:var(--font-display);font-optical-sizing:auto;font-weight:560}
.checkline{display:flex;align-items:center;gap:10px;margin:14px 0}
.checkline input{width:auto}
.checkline label{margin:0;color:var(--text);font-size:.95rem}
.err{background:color-mix(in srgb,var(--danger) 13%,transparent);border:1px solid var(--danger);color:var(--text);border-radius:var(--radius-champ);padding:10px 12px;margin:12px 0;font-size:.92rem}
.okmsg{background:color-mix(in srgb,var(--ok) 13%,transparent);border:1px solid var(--ok);border-radius:var(--radius-champ);padding:10px 12px;margin:12px 0;font-size:.92rem}
/* Coquille applicative */
.shell{display:flex;min-height:100vh}
.sidebar{width:230px;flex:0 0 230px;background:var(--surface);border-right:1px solid var(--border);padding:20px 16px;display:flex;flex-direction:column;gap:4px}
.sidebar .brand{font-family:var(--font-display);font-optical-sizing:auto;font-weight:560;font-size:1.3rem;letter-spacing:.01em;padding:4px 10px 14px}
.sidebar .brand small{display:block;font-family:var(--font-texte);font-weight:500;color:var(--muted);font-size:.78rem;margin-top:2px}
/* Le « 1 » signature de la porte, décliné dans le mot-symbole console */

.navbtn{display:block;width:100%;text-align:left;background:transparent;border:none;color:var(--text);padding:10px 12px;border-radius:var(--radius-champ);font-size:.98rem;transition:background .16s ease}
.navbtn:hover{background:var(--surface-2)}
.navbtn.active{background:var(--surface-2);box-shadow:inset 3px 0 0 var(--accent)}
.sidebar .spacer{flex:1}
/* Barre latérale fixe (2026-11-21) : haute comme l'écran, donc le
   courriel et « Se déconnecter » restent visibles en bas même sur une
   page longue — avant, ils n'apparaissaient qu'au bout du défilement. */
@media(min-width:821px){
  .sidebar{position:sticky;top:0;height:100vh;overflow-y:auto}
}
.main{flex:1;padding:24px;max-width:1100px;margin:0 auto;width:100%}
.topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}
h2{margin:6px 0 4px;font-family:var(--font-texte);font-weight:650;font-size:1.55rem;letter-spacing:-.02em}
/* Cible du focus programmatique à chaque changement de vue (C3) : pas d'anneau */
.main h2[tabindex="-1"]:focus{outline:none}
h3{font-family:var(--font-texte);font-weight:650;letter-spacing:-.01em}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px;margin:16px 0}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px}
.stat .num{font-family:var(--font-display);font-optical-sizing:auto;font-size:2rem;font-weight:600;line-height:1.1}
.stat .num .pill{font-family:var(--font-texte)}
.stat .lbl{color:var(--muted);font-size:.88rem;margin-top:4px}
table{width:100%;border-collapse:collapse}
/* Chiffres tabulaires (faille n° 1 de la revue des polices, 2026-11-18) :
   les nombres en colonnes (dates, durées, numéros de ligne) et les
   compteurs/statistiques restent alignés et stables — les chiffres
   proportionnels par défaut d'Inter ne le permettaient pas. */
table,.stat .num{font-variant-numeric:tabular-nums}
th,td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--border);font-size:.94rem;vertical-align:top}
th{color:var(--muted);font-weight:600}
tr.clickable{cursor:pointer}
tr.clickable:hover td{background:var(--surface-2)}
tr.clickable:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.pill{display:inline-block;padding:2px 9px;border-radius:999px;font-size:.78rem;border:1px solid var(--border);background:var(--surface-2)}
.pill.ok{border-color:var(--ok);color:var(--ok)}
.pill.urgence{border-color:var(--danger);color:var(--danger)}
.pill.att{border-color:var(--danger);background:var(--danger);color:var(--bg)}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 4px}
.chip{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:999px;padding:6px 14px;cursor:pointer;font:inherit;font-size:.9rem}
.chip:hover{background:var(--surface-2)}
.chip.active{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.resume-cell{max-width:340px}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;margin-top:14px}
.cal-day{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:10px;min-height:110px}
.cal-day h4{margin:0 0 8px;font-size:.85rem}
.cal-evt{border-left:3px solid var(--accent);padding:4px 0 4px 8px;margin-bottom:8px;font-size:.88rem}
.res-row{display:flex;align-items:center;gap:10px;margin:6px 0}
.res-row .res-lbl{flex:0 0 130px}
.res-row .res-track{flex:1;background:var(--surface-2);border-radius:6px;height:14px;overflow:hidden}
.res-row .res-fill{background:var(--accent);height:100%}
.res-row .res-n{flex:0 0 40px;text-align:right}
.proc-item{border:1px solid var(--border);border-radius:var(--radius);padding:14px;margin:12px 0}
.live-card{background:linear-gradient(var(--surface),var(--surface)) padding-box,linear-gradient(90deg,#2e63e7,#a24fd6,#ff7aa8) border-box;border:1px solid transparent;box-shadow:0 10px 34px rgba(0,0,0,.28)}
.live-wave{display:block;width:100%;height:104px;margin-top:6px}
.live-qui{margin:4px 0 0}
.live-bulles{margin-top:12px;background:var(--surface-2);border:1px solid var(--border);border-radius:14px;padding:12px;min-height:110px;max-height:340px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}
.live-bulles .l-vide{margin:auto;text-align:center;color:var(--muted);font-size:.92rem;padding:18px 10px}
.l-bulle{max-width:82%;padding:8px 12px;border-radius:14px;font-size:.95rem;line-height:1.45}
.l-bulle p{margin:0}
.l-bulle .l-qui{display:block;font-size:.66rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;margin-bottom:3px}
.l-bulle.agent{align-self:flex-start;background:var(--surface);border:1px solid var(--border);border-bottom-left-radius:5px;color:var(--text)}
.l-bulle.agent .l-qui{background:linear-gradient(90deg,#2e63e7,#a24fd6,#ff7aa8);-webkit-background-clip:text;background-clip:text;color:transparent}
.l-bulle.vous{align-self:flex-end;background:linear-gradient(120deg,#2e63e7,#a24fd6,#ff7aa8);border-bottom-right-radius:5px;color:#fff}
.l-bulle.vous .l-qui{color:rgba(255,255,255,.75)}
.live-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--ok);margin-right:7px;vertical-align:1px;animation:livePulse 1.6s ease-in-out infinite}
@keyframes livePulse{0%,100%{opacity:1}50%{opacity:.35}}
@media (prefers-reduced-motion: reduce){.live-dot{animation:none}}
.main.client .topbar{position:relative;padding-bottom:12px}
.main.client .topbar::after{content:'';position:absolute;left:0;bottom:0;height:2px;width:132px;border-radius:2px;background:linear-gradient(90deg,#2e63e7,#a24fd6,#ff7aa8)}
@media(max-width:900px){.cal-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.cal-grid{grid-template-columns:1fr}}
.rowflex{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.rowflex>*{flex:0 1 auto}
.grow{flex:1 1 auto}
.empty{border:1px dashed var(--border);border-radius:var(--radius);padding:24px;text-align:center;color:var(--muted);margin:16px 0}
.badge-attn{display:inline-block;background:var(--danger);color:#fff;border-radius:99px;font-size:.72rem;font-weight:700;padding:1px 7px;margin-left:6px;vertical-align:2px}
/* Pastilles de thèmes : rond coupé 50/50 en diagonale, aucun texte */
#themes-panel{padding:8px 10px 4px}
#themes-panel .swatches{flex-wrap:wrap;overflow:visible}
.navbtn[aria-expanded="true"]{background:var(--surface-2)}
.swatches{display:flex;gap:10px;flex-wrap:nowrap;overflow-x:auto;padding:4px 2px}
.swatch{flex:0 0 auto;width:40px;height:40px;border-radius:50%;border:1px solid var(--border);padding:0;cursor:pointer}
.swatch.active{box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--accent)}
@media(min-width:1024px){.swatches{flex-wrap:wrap;overflow:visible;max-width:150px}}
/* Éditeur d'heures et de FAQ */
.hours-day{border:1px solid var(--border);border-radius:var(--radius-champ);padding:10px 12px;margin:8px 0;background:var(--surface)}
.hours-day .dname{font-weight:700;width:90px;display:inline-block}
.range-row{display:flex;gap:8px;align-items:center;margin:6px 0 6px 90px}
.range-row input{width:130px}
.faq-item{border:1px solid var(--border);border-radius:var(--radius-champ);padding:12px;margin:10px 0;background:var(--surface)}
/* Modale d'appel : <dialog> natif + showModal() (C1, contrat APG) —
   Échap, fond inerte et retour de focus sont fournis par la plateforme ;
   le titre est rattaché par aria-labelledby côté app.js. */
dialog.modal{margin:auto;max-height:calc(100vh - 48px);overflow:auto;color:var(--text)}
dialog.modal::backdrop{background:#000a}
.modal{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);max-width:760px;width:100%;padding:24px}
.transcript{white-space:pre-wrap;background:var(--surface-2);border-radius:var(--radius-champ);padding:12px;font-size:.92rem;line-height:1.5}
.hero-phrase{font-family:var(--font-display);font-optical-sizing:auto;font-size:1.4rem;line-height:1.4;font-weight:500}
@media(max-width:820px){
  .shell{flex-direction:column}
  .sidebar{width:100%;flex:none;flex-direction:row;flex-wrap:wrap;align-items:center;border-right:none;border-bottom:1px solid var(--border)}
  .sidebar .brand{padding:4px 8px}
  .sidebar .spacer{display:none}
  .navbtn{width:auto;padding:8px 10px}
  .main{padding:16px}
}

.table-scroll{overflow-x:auto}
.table-scroll table{min-width:780px}
/* Console mobile : la carte-tableau ne doit jamais élargir la page —
   la grille laisse min-width:auto à ses enfants, la table (780 px min)
   forçait alors tout le layout. */
.main{min-width:0}
.card.table-scroll{max-width:100%}

/* ---------- Passe « tableau de bord » (2026-11-19, style demandé par Jonathan) ----------
   Langage : fond noir/charbon profond, panneaux à bordure fine et coins
   arrondis, étiquettes en petites capitales grises espacées, très gros
   chiffres blancs tabulaires, UN seul accent (le bleu Ligne1 #3b9eff,
   gardé tel quel), variations discrètes vert/rouge avec flèche, filets
   de séparation fins, beaucoup d'air, aucune décoration inutile.
   Les composants .nx-* portent ce langage ; ils vivent des variables du
   thème actif (la rampe sombre par défaut le réalise tel quel).
   Règle d'honnêteté inchangée : ces panneaux n'affichent que des sommes
   d'appels réels — à zéro, un état vide propre remplace tout graphique. */
.nx-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin:16px 0;overflow:hidden}
.nx-head{padding:20px 22px 16px}
.nx-eyebrow{font-size:.72rem;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin:0}
.nx-title{font-size:1.3rem;font-weight:650;letter-spacing:-.015em;margin:6px 0 0}
.nx-note{padding:0 22px 18px;color:var(--muted);font-size:.95rem;line-height:1.55;margin:0}
.nx-note strong{color:var(--text);font-weight:600}
.nx-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--border);border-top:1px solid var(--border)}
.nx-grid.c3{grid-template-columns:repeat(3,1fr)}
@media(max-width:820px){.nx-grid.c3{grid-template-columns:1fr 1fr}}
.nx-stat{background:var(--surface);padding:18px 22px 20px;min-width:0}
.nx-lbl{font-size:.72rem;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin:0 0 10px}
.nx-num{font-size:2.65rem;font-weight:600;line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.nx-var{margin:9px 0 0;font-size:.86rem;font-weight:550}
.nx-var.up{color:var(--ok)}
.nx-var.down{color:var(--danger)}
.nx-var.flat{color:var(--muted)}
.nx-sous{margin:9px 0 0;font-size:.86rem;color:var(--muted);line-height:1.45}
.nx-vide{padding:24px 22px;color:var(--muted);line-height:1.6}
.nx-vide strong{display:block;color:var(--text);font-weight:600;font-size:1.02rem;margin-bottom:4px}
.nx-chart{padding:20px 22px 16px}
.nx-chart-head{display:flex;justify-content:space-between;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:6px}
.nx-chart-title{font-size:1.02rem;font-weight:650;letter-spacing:-.01em;margin:0}
.nx-legend{display:flex;gap:18px;font-size:.85rem;color:var(--muted);flex-wrap:wrap}
.nx-legend .dot{display:inline-block;width:16px;height:4px;border-radius:2px;background:var(--accent);vertical-align:middle;margin-right:7px}
.nx-legend .dot.gris{background:repeating-linear-gradient(90deg,var(--muted) 0 3px,transparent 3px 6px)}
.nx-svg{width:100%;height:auto;display:block}
.nx-svg .grille{stroke:var(--border);stroke-width:1}
.nx-svg .ligne-a{fill:none;stroke:var(--accent);stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round}
.nx-svg .ligne-b{fill:none;stroke:var(--muted);stroke-width:1.6;stroke-dasharray:2 4;stroke-linecap:round}
.nx-svg .pt-a{fill:var(--accent)}
.nx-svg text{fill:var(--muted);font-size:10.5px;font-family:var(--font-texte)}
.nx-bars{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;padding:16px 22px 20px}
.nx-bar-col{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0}
.nx-bar-track{height:148px;width:100%;display:flex;align-items:flex-end;justify-content:center}
.nx-bar{width:100%;max-width:64px;border-radius:7px 7px 3px 3px;background:color-mix(in srgb,var(--text) 17%,transparent)}
.nx-bar.max{background:var(--accent)}
.nx-bar-jour{font-size:.8rem;color:var(--muted)}
.nx-services{display:flex;gap:10px 28px;flex-wrap:wrap;padding:16px 22px;border-top:1px solid var(--border)}
.nx-service{display:flex;align-items:center;gap:9px;font-size:.92rem}
.nx-service .svc-lbl{color:var(--muted);font-size:.72rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase}

/* Voyant du switch « qui répond » (2026-11-21) : rond lumineux, vert quand
   SophIA répond, orange en mode « je réponds moi-même » (ne pas déranger).
   Même langage visuel que le bouton rond lumineux prévu au widget. */
.voyant{display:inline-block;width:13px;height:13px;border-radius:50%;margin-right:8px;vertical-align:-1px}
.voyant.sophia{background:#22c55e;box-shadow:0 0 8px 2px rgba(34,197,94,.55)}
.voyant.moi{background:#f59e0b;box-shadow:0 0 8px 2px rgba(245,158,11,.55)}
