/* =====================================================================
   (28/11/2026) Direction « Cockpit » : demande du 28/11 (« une sorte d'Infloww, mais quelque chose d'unique »), maquette
   validée : Bureau\SubScale design\cockpit\maquette-cockpit.html. Chargée après harmonie.css et AVANT telephone.css (qui reste
   la dernière feuille), même astuce de spécificité que les autres feuilles (:is(#gs,*) puis :not(#ck1):not(#ck2)).
   Purement visuel : aucun id, aucune classe, aucune fonction ne change (la barre du haut vient de public/cockpit.js).
   - Sombre : noir neutre (#060606), menu #0A0A0A, cartes détachées (#141414) ; Clair : gris neutre et cartes blanches.
   - Menu de gauche plus grand et plus lisible : entrées de 40 px en Hanken Grotesk, rubriques avec leur icône, entrée
     active en pastille avec le filet de la couleur d'accent, sélecteur de créatrice et compte en cartes.
   - Cartes à 18 px de rayon, titres de page et chiffres clés en Hanken Grotesk 800.
   ===================================================================== */

/* ---------- jetons · Sombre ---------- */
:root:root:root:root:not([data-theme="light"]), :root:root:root:root.studio-ui.studio-ui:not([data-theme="light"]) {
  --bg: #060606 !important; --bg-2: #0C0C0C !important; --surface: #141414 !important; --surface-2: #1C1C1C !important; --surface-3: #282828 !important;
  --line: #242424 !important; --line-2: #343434 !important;
  --fg: #F4F4F2 !important; --fg-2: #D4D4D0 !important; --muted: #A3A39E !important; --muted-2: #86867F !important;
  --sel-bg: #1C1C1C !important; --chip-bg: #1F1F1F !important; --tile-bg: #181818 !important;
  --gs-row: #181818 !important; --gs-line-soft: #202020 !important; --gs-input: #101010 !important; --gs-pop: #181818 !important;
  --gs-wait-bg: #1F1F1F !important; --gs-wait-line: #343434 !important;
  --pro-seg-on: #262626; --pro-sh2: 0 10px 28px -10px rgba(0, 0, 0, .7); --pro-sh3: 0 24px 48px -12px rgba(0, 0, 0, .75);
  --ck-page: #060606; --ck-side: #0A0A0A; --ck-up: #4ADE80; --ck-warn: #E8B465; --ck-bad: #F05252;
}
/* ---------- jetons · Clair ---------- */
:root:root:root:root[data-theme="light"], :root:root:root:root.studio-ui.studio-ui[data-theme="light"] {
  --bg: #EEEFF2 !important; --bg-2: #E7E8EC !important; --surface: #FFFFFF !important; --surface-2: #F4F5F7 !important; --surface-3: #E5E7EB !important;
  --line: #E3E5E9 !important; --line-2: #D0D3D9 !important;
  --fg: #111113 !important; --fg-2: #2E2E33 !important; --muted: #5C5C64 !important; --muted-2: #73737B !important;
  --sel-bg: #FFFFFF !important; --chip-bg: #F1F2F5 !important; --tile-bg: #F7F8FA !important;
  --gs-row: #F7F8FA !important; --gs-line-soft: #EEF0F3 !important; --gs-input: #FFFFFF !important; --gs-pop: #FFFFFF !important;
  --gs-wait-bg: #F1F2F5 !important; --gs-wait-line: #D0D3D9 !important;
  --pro-seg-on: #FFFFFF;
  --ck-page: #EEEFF2; --ck-side: #F8F8FA; --ck-up: #15964F; --ck-warn: #B9791B; --ck-bad: #D63B3B;
}
:root:root:root:root, :root:root:root:root[data-theme] { --side: 256px; --card-r: 18px !important; --d4-r: 18px !important; }

/* ---------- coque (ordinateur) : plus de « feuille », la page est le fond noir et les cartes s'en détachent ---------- */
@media (min-width: 761px) {
  html body .app:is(#gs,*):not(#ck1):not(#ck2) { background: var(--ck-page) !important; }
  html body .app > .main:is(#gs,*):not(#ck1):not(#ck2) { margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: var(--ck-page) !important; }
  html body .app > .main :is(.view, main.scroll):is(#gs,*):not(#ck1):not(#ck2) { background: var(--ck-page) !important; }
}

/* ---------- menu de gauche ---------- */
html body :is(#gs, .app) .side:is(#gs,*):not(#ck1):not(#ck2) { background: var(--ck-side) !important; border-right: 1px solid var(--line) !important; }
html body :is(#gs, .app) .side .brand .wm:is(#gs,*):not(#ck1):not(#ck2) { font-size: 18px !important; font-weight: 800 !important; }
/* la créatrice : une carte comme le sélecteur de plateforme d'Infloww */
html body :is(#gs, .app) .side .ctx-btn:is(#gs,*):not(#ck1):not(#ck2) { padding: 9px 9px 9px 9px !important; border-radius: 14px !important; background: var(--surface) !important; border: 1px solid var(--line) !important; gap: 10px !important; transition: border-color .2s, transform .25s cubic-bezier(.3, 1.4, .5, 1) !important; }
html body :is(#gs, .app) .side .ctx-btn:hover:is(#gs,*):not(#ck1):not(#ck2) { border-color: var(--line-2) !important; transform: translateY(-1px); }
html body :is(#gs, .app) .side .ctx-av:is(#gs,*):not(#ck1):not(#ck2) { width: 32px !important; height: 32px !important; min-width: 32px; border-radius: 50% !important; }
html body :is(#gs, .app) .side .ctx-t b:is(#gs,*):not(#ck1):not(#ck2) { font: 700 14px/1.2 var(--font-display) !important; }
/* la recherche : une vraie barre */
html body :is(#gs, .app) .side .kbar:is(#gs,*):not(#ck1):not(#ck2) { height: 38px !important; border-radius: 11px !important; border: 1px solid var(--line) !important; font-size: 13.5px !important; }
@media (min-width: 761px) {
  /* entrées : 40 px, Hanken Grotesk, icônes de 19 px */
  html body:not(.side-mini) :is(#gs, .app) .side .nav > [data-view]:not(.nav-sub):is(#gs,*):not(#ck1):not(#ck2),
  html body:not(.side-mini) :is(#gs, .app) .side .nav > .nav-sec:is(#gs,*):not(#ck1):not(#ck2) {
    position: relative; min-height: 40px !important; height: 40px !important; padding: 0 11px !important; gap: 12px !important; border-radius: 12px !important;
    font: 600 15px/1 var(--font-display) !important; letter-spacing: -.005em !important; color: var(--fg-2) !important;
  }
  html body :is(#gs, .app) .side .nav > :is([data-view], .nav-sec) > svg:is(#gs,*):not(#ck1):not(#ck2) { width: 19px !important; height: 19px !important; min-width: 19px; color: var(--muted) !important; stroke-width: 1.75 !important; }
  /* rubriques d'une section : leur icône revient (comme Infloww), sur un filet */
  html body:not(.side-mini) :is(#gs, .app) .side .nav > .nav-sub:is(#gs,*):not(#ck1):not(#ck2) {
    position: relative; min-height: 36px !important; height: 36px !important; gap: 10px !important; margin-left: 20px !important; width: calc(100% - 20px) !important;
    padding-left: 12px !important; font: 500 14px/1 Inter, sans-serif !important; color: var(--muted) !important; border-radius: 0 10px 10px 0 !important;
  }
  html body:not(.side-mini) :is(#gs, .app) .side .nav > .nav-sub > svg:is(#gs,*):not(#ck1):not(#ck2) { display: block !important; width: 16px !important; height: 16px !important; min-width: 16px; color: var(--muted-2) !important; }
  html body:not(.side-mini) :is(#gs, .app) .side .nav > .nav-sub:is([aria-current="page"], .active, .on):is(#gs,*):not(#ck1):not(#ck2) { background: var(--surface-2) !important; color: var(--fg) !important; font-weight: 600 !important; border-left-color: var(--acc) !important; box-shadow: -1px 0 0 var(--acc) !important; }
  html body:not(.side-mini) :is(#gs, .app) .side .nav > .nav-sub:is([aria-current="page"], .active, .on) > svg:is(#gs,*):not(#ck1):not(#ck2) { color: var(--acc) !important; }
}
/* entrée active : pastille + filet de la couleur d'accent, icône dans la couleur */
html body :is(#gs, .app) .side .nav > [data-view]:not(.nav-sub):is([aria-current="page"], .active, .on):is(#gs,*):not(#ck1):not(#ck2) { background: var(--surface-2) !important; border-color: transparent !important; box-shadow: none !important; color: var(--fg) !important; }
html body :is(#gs, .app) .side .nav > [data-view]:not(.nav-sub):is([aria-current="page"], .active, .on) > svg:is(#gs,*):not(#ck1):not(#ck2) { color: var(--acc) !important; }
@media (min-width: 761px) {
  html body:not(.side-mini) :is(#gs, .app) .side .nav > [data-view]:not(.nav-sub)[aria-current="page"]:is(#gs,*):not(#ck1):not(#ck2)::before {
    content: "" !important; display: block !important; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc);
  }
}
html body :is(#gs, .app) .side .nav :is(button, a):not([aria-current="page"]):hover:is(#gs,*):not(#ck1):not(#ck2) { background: var(--surface-2) !important; color: var(--fg) !important; }
html body :is(#gs, .app) .side .nav-sec[aria-expanded="true"]:not([aria-current="page"]):is(#gs,*):not(#ck1):not(#ck2) { color: var(--fg) !important; }
/* titres de groupe : en capitales espacées, comme la maquette */
html body :is(#gs, .app) .side .nav > .nav-label.nav-grp:is(#gs,*):not(#ck1):not(#ck2) { margin: 16px 0 6px !important; padding: 0 11px !important; font: 700 10.5px/1 Inter, sans-serif !important; letter-spacing: .09em !important; text-transform: uppercase !important; color: var(--muted-2) !important; }
/* compteurs : pastilles ; les non lus de Messages dans la couleur d'accent */
html body :is(#gs, .app) .side .nav .count:not([hidden]):is(#gs,*):not(#ck1):not(#ck2) { min-width: 22px; height: 20px; padding: 0 7px !important; border-radius: 999px !important; background: var(--surface-2) !important; color: var(--fg-2) !important; font: 700 11px/20px Inter, sans-serif !important; text-align: center; }
html body :is(#gs, .app) .side .nav [data-view="inbox"] .count:not([hidden]):is(#gs,*):not(#ck1):not(#ck2) { background: var(--acc) !important; color: var(--acc-ink) !important; }
/* le compte, en bas : une carte */
html body :is(#gs, .app) .side-foot:is(#gs,*):not(#ck1):not(#ck2) { border-top: 0 !important; }
html body :is(#gs, .app) .side-foot .me:is(#gs,*):not(#ck1):not(#ck2) { border: 1px solid var(--line) !important; background: var(--surface) !important; border-radius: 14px !important; }
html body :is(#gs, .app) .side-foot .me:hover:is(#gs,*):not(#ck1):not(#ck2) { border-color: var(--line-2) !important; }
html body :is(#gs, .app) .side-foot .me strong:is(#gs,*):not(#ck1):not(#ck2) { font: 700 13.5px/1.2 var(--font-display) !important; }

/* ---------- cartes : plus rondes, bien détachées du fond ---------- */
html body :is(#gs, .app) :is(.card, .dbx-card, .dbx4-card, .cl-card, .bl-card, .rq-list, .gr-panel, .rl2-main, .fo-path, .vai-panel, .fxv-panel, .ibp-card, .dbx5-strip, .rq-kpi, .v-kpis, .gr-kpis, .rl2-group, .fo-resume, .vai-tiles, .sx-kpi, .kpis > .kpi, .gr-kpis > .gr-kpi, .iac-kpis > .iac-kpi, .fx-rev-kpis > div):is(#gs,*):not(#ck1):not(#ck2) { border-radius: 18px !important; }

/* ---------- titres de page et chiffres clés en Hanken Grotesk 800 (ordinateur) ---------- */
@media (min-width: 761px) {
  html body :is(#gs, .app) .viewbar h1:is(#gs,*):not(#ck1):not(#ck2) { font: 800 28px/1.15 var(--font-display) !important; letter-spacing: -.028em !important; }
  /* (toutes les tuiles alignées par le lot 5 sur .sx-kpi gardent le même gabarit : tests/harmonie.mjs le vérifie) */
  html body :is(#gs, .app) :is(.sx-kpi .sx-v, .kpis > .kpi > strong, .gr-kpis > .gr-kpi > b, .iac-kpis > .iac-kpi > b, .fx-rev-kpis > div > b):is(#gs,*):not(#ck1):not(#ck2) { font-weight: 800 !important; font-size: 26px !important; letter-spacing: -.025em !important; }
  html body :is(#gs, .app) .dbx-kpis > .dbx-k > b:is(#gs,*):not(#ck1):not(#ck2) { font-weight: 800 !important; letter-spacing: -.028em !important; }
}

/* ---------- barre du haut (ordinateur, public/cockpit.js) ---------- */
.app .ck-top { display: none; }
@media (min-width: 761px) {
  html body .app .ck-top:not([hidden]) { display: flex; align-items: center; gap: 10px; flex: none; height: 60px; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--ck-page); }
  .app .ck-when { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 500 13px/1 Inter, sans-serif; white-space: nowrap; }
  .app .ck-when b { color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }
  .app .ck-when svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .app .ck-pills { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .app .ck-top .ck-pl { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 600 13.5px/1 var(--font-display); white-space: nowrap; cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s; }
  .app .ck-top .ck-pl:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-1px); }
  .app .ck-top .ck-pl:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
  .app .ck-top .ck-pl[hidden] { display: none; }
  .app .ck-top .ck-pl > svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .app .ck-led { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex: none; }
  .app .ck-pl[data-st="ok"] .ck-led { background: var(--ck-up); box-shadow: 0 0 10px var(--ck-up); }
  .app .ck-pl[data-st="warn"] .ck-led { background: var(--ck-warn); box-shadow: 0 0 10px var(--ck-warn); }
  .app .ck-pl[data-st="bad"] { border-color: color-mix(in srgb, var(--ck-bad) 55%, var(--line)); }
  .app .ck-pl[data-st="bad"] .ck-led { background: var(--ck-bad); box-shadow: 0 0 10px var(--ck-bad); }
  .app .ck-top .ck-ai { border-color: color-mix(in srgb, var(--acc) 40%, var(--line)); }
  .app .ck-mk { width: 16px; height: 16px; flex: none; overflow: visible; }
  .app .ck-mk rect { transform-box: fill-box; transform-origin: center; }
  .app .ck-mk .qa { fill: var(--acc); }
  .app .ck-mk .qb { fill: var(--fg); }
  html[data-motion="full"] .app .ck-mk .qa { animation: ck-brA 3.4s ease-in-out infinite; }
  html[data-motion="full"] .app .ck-mk .qb { animation: ck-brB 3.4s ease-in-out infinite; }
  @keyframes ck-brA { 50% { transform: translate(-5px, 5px); } }
  @keyframes ck-brB { 50% { transform: translate(5px, -5px); } }
  .app .ck-top .ck-bell { position: relative; width: 38px; padding: 0; justify-content: center; }
  .app .ck-bell u { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--ck-bad); border: 2px solid var(--surface); }
  .app .ck-bell u[hidden] { display: none; }
}
@media (prefers-reduced-motion: reduce) { .app .ck-mk rect { animation: none !important; } .app .ck-top .ck-pl { transition: none; } }

/* ---------- menu (ordinateur) : seules les entrées défilent, la créatrice en haut et le compte en bas restent visibles ---------- */
@media (min-width: 761px) {
  /* (dans l’appli SubScale, html.studio-nav : le menu passe dans la barre de l’appli et celui de la page reste caché, app.css) */
  html:not(.studio-nav) body :is(#gs, .app) .side:is(#gs,*):not(#ck1):not(#ck2) { display: flex !important; flex-direction: column !important; overflow: hidden !important; }
  html body :is(#gs, .app) .side > :is(.brand-row, .ctx, .kbar, .side-foot):is(#gs,*):not(#ck1):not(#ck2) { flex: none !important; }
  /* (le filet de l'entrée active dépasse de 10 px à gauche : la zone qui défile commence 10 px plus tôt pour ne pas le couper) */
  html body :is(#gs, .app) .side > .nav:is(#gs,*):not(#ck1):not(#ck2) { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; overscroll-behavior: contain; margin-left: -10px !important; padding-left: 10px !important; margin-right: -6px !important; padding-right: 6px !important; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
}
/* thème clair : l'entrée active en carte blanche (sur le menu gris clair, une pastille grise se voyait à peine) */
html[data-theme="light"] body :is(#gs, .app) .side .nav > [data-view]:not(.nav-sub):is([aria-current="page"], .active, .on):is(#gs,*):not(#ck1):not(#ck2),
html[data-theme="light"] body:not(.side-mini) :is(#gs, .app) .side .nav > .nav-sub:is([aria-current="page"], .active, .on):is(#gs,*):not(#ck1):not(#ck2) { background: var(--surface) !important; box-shadow: 0 1px 2px rgba(16, 16, 20, .06), inset 0 0 0 1px var(--line) !important; }
html[data-theme="light"] body:not(.side-mini) :is(#gs, .app) .side .nav > .nav-sub:is([aria-current="page"], .active, .on):is(#gs,*):not(#ck1):not(#ck2) { box-shadow: -1px 0 0 var(--acc), 0 1px 2px rgba(16, 16, 20, .06), inset 0 0 0 1px var(--line) !important; }
/* barre du haut : le jour, l'heure et le fuseau espacés */
.app .ck-when #ck-when-t { display: inline-flex; align-items: center; gap: 8px; }

/* (28/11/2026) appli SubScale (html.studio-nav, desktop/preload.js) : elle a sa propre barre de gauche et son propre en-tête ;
   le menu de la page reste caché (app.css) et la barre du haut de la page n’y apparaît pas (avant : menu de la page réaffiché
   par-dessus et barre du haut en double, signalé par l’utilisateur le 28/11) */
html.studio-nav body .app .ck-top, html.studio-nav body .app .ck-top:not([hidden]) { display: none !important; }
html.studio-nav body :is(#gs, .app) .side:is(#gs,*):not(#ck1):not(#ck2):not(#ck3) { display: none !important; }
