/* ============================================================================
   COCKPIT SHELL — chrome commun aux pages cockpit (vue interne + vue client).
   Surcouche MINCE sur la charte Optima (tokens = charte) : header sticky, marque,
   interrupteur de thème, en-têtes de section, scrollbars, conteneur .wrap.
   Mutualisé depuis projet.html / client.html (était dupliqué mot-pour-mot).
   Chargé APRÈS optima-charte-ui.css + ajustements.css, AVANT le <style> de page :
   les retouches en ligne et les règles spécifiques de page gardent la priorité.
   ============================================================================ */

/* Compat : le JS fait .style.color = "var(--ok)" (état live) */
:root{ --ok: var(--status-success); }
body{ padding-bottom: var(--space-7); }

/* Scrollbars légères */
*{ scrollbar-width:thin; scrollbar-color:color-mix(in oklab, var(--text-faint) 55%, transparent) transparent; }
*::-webkit-scrollbar{ width:7px; height:7px; }
*::-webkit-scrollbar-track{ background:transparent; }
*::-webkit-scrollbar-thumb{ background:color-mix(in oklab, var(--text-faint) 45%, transparent); border-radius:99px; border:2px solid transparent; background-clip:padding-box; }
*::-webkit-scrollbar-thumb:hover{ background:var(--text-faint); }
.wrap{ width:100%; max-width:var(--w-content); margin:0 auto; padding:0 var(--space-5); }

/* Header — surface charte, sticky, hairline */
header{ position:sticky; top:0; z-index:30; background:color-mix(in oklab, var(--bg-panel) 86%, transparent); backdrop-filter:blur(10px); border-bottom:1px solid var(--border); padding:var(--space-4) 0; margin-bottom:var(--space-5); }
.head-row{ display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); flex-wrap:wrap; }
/* Marque — logo immeuble + « Cockpit » */
.brand{ display:inline-flex; align-items:center; gap:var(--space-3); text-decoration:none; white-space:nowrap; }
.brand img{ height:calc(28px * var(--ui-scale)); width:auto; display:block; }
.brand .ck{ font-family:var(--font-sans); font-weight:var(--fw-heavy); font-size:var(--fs-xl); letter-spacing:var(--tracking-heading); color:var(--text-main); line-height:1; }
[data-theme="dark"] .brand img{ filter:brightness(1.32) saturate(1.08); }
.head-meta{ display:flex; align-items:center; gap:var(--space-2); flex-wrap:wrap; }
.head-sub{ margin-top:var(--space-3); font-size:var(--fs-sm); color:var(--text-muted); display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.head-sub b{ color:var(--text-body); font-weight:var(--fw-semibold); }
/* Boutons-icône du header (text-decoration:none → utilisable sur <a> comme <button>) */
.hbtn{ display:inline-flex; align-items:center; gap:var(--space-2); height:var(--ctrl-h); padding:0 var(--space-3); border:1px solid var(--border); border-radius:var(--radius-md); background:var(--bg-panel); color:var(--text-body); font-family:inherit; font-size:var(--fs-sm); font-weight:var(--fw-medium); text-decoration:none; cursor:pointer; transition:background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.hbtn:hover{ background:var(--bg-hover); color:var(--text-main); }
.hbtn svg{ width:16px; height:16px; }
/* Interrupteur segmenté clair/sombre */
.theme-switch{ display:inline-flex; align-items:center; padding:3px; border-radius:var(--radius-pill); background:var(--bg-active); border:1px solid var(--border); box-shadow:var(--neu-inset); }
.theme-switch button{ display:inline-grid; place-items:center; width:calc(30px * var(--ui-scale)); height:calc(26px * var(--ui-scale)); border:none; background:transparent; color:var(--text-faint); border-radius:var(--radius-pill); cursor:pointer; transition:background var(--dur) var(--ease), color var(--dur) var(--ease); }
.theme-switch button svg{ width:15px; height:15px; }
.theme-switch button[aria-pressed="true"]{ background:var(--grad-brand); color:#fff; box-shadow:var(--shadow-glow); }

/* En-têtes de section — système de titres (N2 = entrée de zone) : casse normale, graisse forte,
   contraste fort + pastille d'accent → décroché net vs les labels (N0, uppercase-muted-faint). */
.section{ margin-bottom:var(--space-6); }
.section + .section{ margin-top:var(--space-6); }   /* respiration = 50% du décroché, gratuit */
.section-h{ display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); margin-bottom:var(--space-3); }
.section-h h2{ display:inline-flex; align-items:center; gap:var(--space-2);
  font-size:var(--fs-xl); font-weight:var(--fw-heavy); letter-spacing:var(--tracking-tight); text-transform:none; color:var(--text-main); }
.section-h h2::before{ content:""; flex:none; width:3px; height:.92em; border-radius:99px; background:var(--app); }
.section-h .aside{ font-size:var(--fs-sm); color:var(--text-faint); }
