/* ═══════════════════════════════════════════════════════════════
   PULSE DESIGN SYSTEM — v1.0 (09/11/2026)
   Console sombre « industrielle » : canevas encre, filets fins,
   un seul accent braise (ember) qui marque l'interactif et l'urgent.
   Documentation : DESIGN.md · page vivante : /design
   Tout est auto-hébergé (CSP 'self') : polices dans /static/fonts.
   ═══════════════════════════════════════════════════════════════ */

/* ── Polices (OFL, variables, sous-ensemble latin) ───────────── */
@font-face {   /* Police maison Back in the Dayz (05 Assets/FONT/BackInTheDayz.otf), 11/11/2026 */
  font-family: "BackInTheDayz"; src: url(/static/fonts/BackInTheDayz.woff2) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  /* Surfaces, du plus profond au plus haut */
  --ink:        #0B0B0C;   /* fond de page */
  --graphite:   #131315;   /* panneaux */
  --steel:      #1B1B1E;   /* champs, survols, sous-panneaux */
  --filament:   #26262A;   /* filets, bordures */
  --filament-2: #34343A;   /* bordures au survol */

  /* Texte */
  --bone:  #F2F2F3;        /* texte principal */
  --ash:   #8B8B92;        /* texte secondaire, labels */
  --smoke: #5C5C64;        /* texte tertiaire, désactivé */

  /* Accent unique */
  --ember:    #F65A1A;     /* action principale, état « chaud » (> 90 %) */
  --spark:    #FF7A38;     /* survol de l'accent */
  --ember-a:  rgba(246, 90, 26, .12);
  --ember-a2: rgba(246, 90, 26, .28);

  /* Sémantique (statuts uniquement, jamais décoratif) */
  --ok:    #4CC38A;
  --ok-a:  rgba(76, 195, 138, .12);
  --bad:   #F0524F;
  --bad-a: rgba(240, 82, 79, .12);

  /* Typo */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Forme */
  --radius:    4px;
  --radius-sm: 2px;
  --hairline:  1px solid var(--filament);

  /* Mouvement */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 120ms;
  --t-med:  220ms;
}

/* ── Base ────────────────────────────────────────────────────── */
html { background: var(--ink); color-scheme: dark; }
body.pds {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  min-height: 100vh;
}
/* Lueur braise en haut à droite — la seule « ambiance » autorisée */
body.pds::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(246, 90, 26, .10), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(246, 90, 26, .05), transparent 60%);
}
/* Contenu au-dessus du halo de fond. :where() = spécificité nulle : les éléments posés
   directement dans <body> par le script (menu des salles .menu, infobulle .tip) gardent
   leur position fixed. Avant le 12/11/2026, cette règle les replaçait en bas de page,
   hors de l'écran (bouton « Toutes les salles » qui semblait ne rien faire). */
:where(body.pds > *:not(dialog)) { position: relative; z-index: 1; }
::selection { background: var(--ember); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--filament); border-radius: 4px; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--filament-2); }

/* Fond quadrillé (écrans d'authentification) */
.grid-bg {
  background-image:
    linear-gradient(var(--filament) 1px, transparent 1px),
    linear-gradient(90deg, var(--filament) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
  opacity: .45;
}

/* ── Typographie ─────────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: .95;
}
.title-caps {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
}
.h-panel { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--bone); }
.eyebrow, .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ash);
}
.mono { font-family: var(--font-mono); }
.num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ash); }
.dim   { color: var(--smoke); }
.accent { color: var(--ember); }
.text-ok  { color: var(--ok); }
.text-bad { color: var(--bad); }
.cursor-block {
  display: inline-block; width: .55em; height: .12em; background: var(--ember);
  vertical-align: baseline; margin-left: .06em;
  animation: pds-blink 1.1s steps(1) infinite;
}
@keyframes pds-blink { 50% { opacity: 0; } }

/* ── Logo ────────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--bone); text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--ember); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1;
}
.logo-word { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.logo-x { width: 1px; height: 22px; background: var(--filament-2); margin: 0 4px; }
.logo-sub  { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--smoke); }

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .4; }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 13px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--ember); color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: var(--spark); }

.btn-secondary { background: transparent; color: var(--bone); border-color: var(--filament); }
.btn-secondary:hover:not(:disabled) { border-color: var(--filament-2); background: var(--steel); }

.btn-ghost { background: transparent; color: var(--ash); }
.btn-ghost:hover:not(:disabled) { color: var(--bone); background: var(--steel); }

.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }

.link { color: var(--ash); text-decoration: none; transition: color var(--t-fast); }
.link:hover { color: var(--bone); }
.link-accent { color: var(--ember); text-decoration: none; }
.link-accent:hover { color: var(--spark); }

/* ── Tags (statuts, compteurs) ───────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border: 1px solid var(--filament-2); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1;
  color: var(--ash); white-space: nowrap;
}
.tag-ember { color: var(--ember); border-color: var(--ember-a2); background: var(--ember-a); }
.tag-ok    { color: var(--ok);    border-color: rgba(76,195,138,.35); background: var(--ok-a); }
.tag-bad   { color: var(--bad);   border-color: rgba(240,82,79,.35);  background: var(--bad-a); }
.tag-solid { color: var(--ink);   border-color: var(--ember); background: var(--ember); }
.tag-quiet { border-color: var(--filament); color: var(--smoke); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { background: var(--ember); box-shadow: 0 0 0 0 var(--ember-a2); animation: pds-ping 1.6s var(--ease) infinite; }
@keyframes pds-ping {
  0%   { box-shadow: 0 0 0 0 rgba(246,90,26,.55); }
  80%  { box-shadow: 0 0 0 7px rgba(246,90,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(246,90,26,0); }
}

.kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border: 1px solid var(--filament-2); border-bottom-width: 2px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 11px; color: var(--ash); background: var(--graphite);
}

/* ── Panneaux ────────────────────────────────────────────────── */
.panel { background: var(--graphite); border: var(--hairline); border-radius: var(--radius); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: var(--hairline);
}
.panel-body { padding: 20px; }
.panel-accent { border-left: 2px solid var(--ember); }
.rule { border: 0; border-top: var(--hairline); margin: 0; }

/* Grille de statistiques à filets (cf. « Plant vitals ») */
/* Filets tracés en ombre portée nette (droite + bas) : le conteneur les rogne sur ses bords. */
.stat-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); overflow: hidden; }
.stat-grid > .stat { padding: 18px 20px; box-shadow: 1px 0 0 var(--filament), 0 1px 0 var(--filament); }
.stat-label { font-size: 12px; color: var(--ash); margin-bottom: 8px; }
.stat-value {
  font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--bone);
}
.stat-unit { font-family: var(--font-mono); font-size: 11px; color: var(--ash); margin-left: 4px; letter-spacing: 0; }
.stat-note { font-family: var(--font-mono); font-size: 11px; color: var(--ash); margin-top: 8px; }

/* Liste de sélection à cocher (page Accès : concerts d'un compte lecture) */
.check { width: 16px; height: 16px; accent-color: var(--ember); flex-shrink: 0; cursor: pointer; }
.pick-list { max-height: 46vh; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer;
            border-top: 1px solid rgba(38, 38, 42, .7); transition: background var(--t-fast); }
.pick-row:first-child { border-top: 0; }
.pick-row:hover { background: var(--steel); }
.pick-row.is-on .row-name { color: var(--bone); }
.pick-row .row-name { color: var(--ash); font-weight: 500; }
.btn.btn-danger { color: var(--bad); }
.btn.btn-danger:hover:not(:disabled) { background: var(--bad-a); color: var(--bad); }

/* ── Champs ──────────────────────────────────────────────────── */
.field {
  width: 100%; height: 40px; padding: 0 14px;
  background: var(--steel); color: var(--bone);
  border: 1px solid var(--filament); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  outline: none; transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.field::placeholder { color: var(--smoke); font-weight: 400; }
.field:hover { border-color: var(--filament-2); }
.field:focus { border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-a); }
.field.is-error { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-a); }
.field.is-saved { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-a); }
.field-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.field-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.field-code { height: 56px; text-align: center; font-family: var(--font-mono); font-size: 26px; letter-spacing: .5em; padding-left: .5em; }
.field-hint { font-size: 12px; color: var(--ash); margin-top: 6px; }
.field-label { display: block; margin-bottom: 8px; }
input[type=number].field::-webkit-inner-spin-button,
input[type=number].field::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number].field { -moz-appearance: textfield; }

/* Recherche principale */
.search { position: relative; }
.search .field { height: 56px; padding-left: 52px; padding-right: 64px; font-size: 16px; background: var(--graphite); }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ash); pointer-events: none; }
.search .kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.search .field:focus ~ .search-icon { color: var(--ember); }

/* Messages (auth.js) */
.msg { font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid; }
.msg-ok  { color: var(--ok);  border-color: rgba(76,195,138,.3); background: var(--ok-a); }
.msg-err { color: var(--bad); border-color: rgba(240,82,79,.3);  background: var(--bad-a); }

/* ── Onglets (soulignement braise) ───────────────────────────── */
.tabs { display: flex; gap: 28px; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 0 15px; background: none; border: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ash);
  transition: color var(--t-fast);
}
.tab:hover { color: var(--bone); }
.tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--ember); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med) var(--ease);
}
.tab[aria-selected="true"] { color: var(--bone); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab-count { font-family: var(--font-mono); font-size: 11px; color: var(--smoke); }
.tab[aria-selected="true"] .tab-count { color: var(--ember); }

/* Sélecteur segmenté (24H / 7D / 30D) */
.seg { display: inline-flex; gap: 2px; }
.seg button {
  height: 26px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--ash); cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em;
}
.seg button:hover { color: var(--bone); }
.seg button[aria-pressed="true"] { color: var(--bone); border-color: var(--filament-2); background: var(--steel); }

/* ── Jauges de remplissage ───────────────────────────────────── */
/* 3 niveaux : < 70 % cendre · 70–90 % os · > 90 % braise.
   Repères fins à 70 % et 90 % sur le rail pour lire le seuil d'un coup d'œil. */
.gauge {
  position: relative; height: 6px; border-radius: 1px; background: var(--steel); overflow: hidden;
}
/* Jauges (10/11/2026, demande d'Emilien) : barre pleine sans repères, toujours braise ;
   grisée quand c'est complet (plus rien à vendre). */
.gauge-fill {
  height: 100%; width: 0; background: var(--ember); border-radius: 1px;
  transition: width 600ms var(--ease), background var(--t-med);
}
.gauge-fill[data-level="full"] { background: var(--ash); }
.gauge-fill[data-level="none"] { background: transparent; }
.gauge-lg { height: 10px; }
.pct { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; }
.pct { color: var(--bone); }
.pct[data-level="full"] { color: var(--ash); }

/* ── Tableaux ────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 20px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--smoke);
  border-bottom: var(--hairline); background: var(--graphite);
}
.table th.sortable { cursor: pointer; user-select: none; transition: color var(--t-fast); }
.table th.sortable:hover { color: var(--bone); }
.table th[aria-sort] { color: var(--bone); }
.table th .sort-arrow { color: var(--ember); margin-left: 4px; }
.table td { padding: 14px 20px; border-bottom: 1px solid rgba(38, 38, 42, .7); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row-link { cursor: pointer; transition: background var(--t-fast); }
.table tbody tr.row-link:hover { background: var(--steel); }
.table tbody tr.row-link:hover .row-name { color: var(--spark); }
.table .right { text-align: right; }
.table-compact th { padding: 9px 16px; }
.table-compact td { padding: 9px 16px; font-size: 13px; }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; }
.empty { padding: 56px 20px; text-align: center; color: var(--ash); }

/* ── Histogramme (ventes par jour) ───────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bars .bar {
  flex: 1 1 0; min-width: 2px; background: #2C2C31; border-radius: 1px 1px 0 0;
  transition: background var(--t-fast); position: relative;
}
.bars .bar:hover { background: var(--ash); }
.bars .bar.is-peak { background: var(--ember); }
.bars .bar.is-neg  { background: var(--bad); opacity: .6; }
.bars-axis {
  display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px;
  border-top: var(--hairline); font-family: var(--font-mono); font-size: 10.5px; color: var(--smoke);
}

/* ── Marque Back in the Dayz (logos et symboles officiels, static/brand/) ───────
   Les SVG servent de masque : la couleur vient de `color` (currentColor), un seul
   fichier pour toutes les teintes. Toujours avec role="img" + aria-label. */
.bitd { display: inline-block; background: currentColor; flex-shrink: 0;
        -webkit-mask: var(--bitd-src) center / contain no-repeat; mask: var(--bitd-src) center / contain no-repeat; }
.bitd-logo   { --bitd-src: url(/static/brand/bitd-logo.svg);      aspect-ratio: 194.7 / 105.5; height: 22px; }
.bitd-picto  { --bitd-src: url(/static/brand/bitd-picto.svg);     aspect-ratio: 194.7 / 105.5; height: 12px; }
.bitd-bid    { --bitd-src: url(/static/brand/bitd-symbol-01.svg); aspect-ratio: 223.7 / 116.4; height: 22px; }
.bitd-word   { --bitd-src: url(/static/brand/bitd-symbol-02.svg); aspect-ratio: 95.7 / 63.8;   height: 16px; }
.bitd-recy   { --bitd-src: url(/static/brand/bitd-symbol-03.svg); aspect-ratio: 112.4 / 135.7; height: 26px; }
.bitd-checker { --bitd-src: url(/static/brand/bitd-damier.svg); aspect-ratio: 1 / 1; height: 56px; }
/* Pied de page Back in the Dayz (comme backinthedayz.be) : adresse + damier */
.bitd-footer { display: flex; align-items: center; gap: 28px; color: var(--bone); }
.bitd-footer-text { font-family: "BackInTheDayz", var(--font-display); font-weight: 400; font-size: 17px; line-height: 1.1;
                    letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.bitd-cycle  { --bitd-src: url(/static/brand/bitd-symbol-06.svg); aspect-ratio: 101.3 / 109.3; height: 22px; }

/* Tampon « Date : … / made in belgium » du brandbook */
.stamp { display: inline-flex; flex-direction: column; padding: 3px 7px 4px; border: 1.5px solid currentColor;
         border-radius: 2px; font-family: var(--font-mono); font-size: 9.5px; line-height: 1.25;
         letter-spacing: .02em; color: var(--ash); }

/* Cadran calendaire du brandbook : jours 1→31 autour, mois 1→12 dedans, année au centre.
   Généré par dateDial() (static/brand.js) ; jour et mois entourés en braise. */
.dial { color: var(--ash); font-family: var(--font-display); font-weight: 600; overflow: visible; }
.dial .dial-on { fill: var(--ember); }
.dial .dial-ring { fill: none; stroke: var(--ember); stroke-width: 1.3; }
.dial .dial-year { fill: var(--bone); font-weight: 700; }

/* ── Analyste (chat Claude, pages/assistant.html) ───────────────── */
.chat-user { margin-left: auto; max-width: min(80%, 640px); padding: 12px 16px; white-space: pre-wrap;
             background: var(--steel); border: var(--hairline); border-radius: var(--radius); font-size: 14.5px; line-height: 1.55; }
.chat-ai { max-width: 760px; }
.chat-ai > * + * { margin-top: 14px; }
.chat-thread { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--radius-sm);
               color: var(--ash); font-size: 13px; line-height: 1.35; background: transparent; border: 0; cursor: pointer;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background var(--t-fast), color var(--t-fast); }
.chat-thread:hover { background: var(--steel); color: var(--bone); }
.chat-thread[aria-current="true"] { background: var(--steel); color: var(--bone); box-shadow: inset 2px 0 0 var(--ember); }
.composer { position: sticky; bottom: 0; padding: 14px 0 18px; background: linear-gradient(to top, var(--ink) 70%, transparent); }
.composer textarea { min-height: 52px; max-height: 220px; resize: none; padding-top: 14px; padding-bottom: 14px; line-height: 1.45; }

/* Texte Markdown rendu par l'Analyste */
.md { font-size: 14.5px; line-height: 1.65; color: #D6D6DA; }
.md > * + * { margin-top: 10px; }
.md h2, .md h3, .md h4 { font-family: var(--font-display); color: var(--bone); font-weight: 600; line-height: 1.25; margin-top: 20px; }
.md h2 { font-size: 19px; } .md h3 { font-size: 16px; } .md h4 { font-size: 14.5px; }
.md > :first-child { margin-top: 0; }
.md strong { color: var(--bone); font-weight: 600; }
.md code { font-family: var(--font-mono); font-size: 12.5px; background: var(--steel); padding: 1px 5px; border-radius: 2px; }
.md ul, .md ol { padding-left: 20px; } .md ul { list-style: disc; } .md ol { list-style: decimal; }
.md li + li { margin-top: 4px; }
.md li::marker { color: var(--smoke); }
.md hr { border: 0; border-top: var(--hairline); margin: 18px 0; }
.md .md-table { overflow-x: auto; border: var(--hairline); border-radius: var(--radius); }
.md table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
         color: var(--ash); font-weight: 500; padding: 9px 12px; border-bottom: var(--hairline); background: var(--graphite); white-space: nowrap; }
.md td { padding: 8px 12px; border-bottom: 1px solid rgba(38, 38, 42, .7); }
.md tr:last-child td { border-bottom: 0; }
.md td.num, .md th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Graphique en courbes (SVG) de l'Analyste */
.linechart { width: 100%; height: auto; overflow: visible; font-family: var(--font-mono); }
.linechart .grid { stroke: var(--filament); stroke-width: 1; }
.linechart .axis { fill: var(--smoke); font-size: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--ash); }
.legend i { display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; }

/* Menu déroulant Pulse (filtre par salle) : remplace la liste <select> du navigateur */
.menu { position: fixed; z-index: 60; width: min(300px, calc(100vw - 16px)); max-height: 360px; display: flex; flex-direction: column;
        background: var(--graphite); border: 1px solid var(--filament-2); border-radius: var(--radius);
        box-shadow: 0 16px 40px rgba(0, 0, 0, .5); overflow: hidden; }
.menu-list { overflow-y: auto; padding: 4px; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px;
             border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ash); font-size: 13px;
             text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--steel); color: var(--bone); outline: none; }
.menu-item[aria-selected="true"] { color: var(--bone); box-shadow: inset 2px 0 0 var(--ember); background: var(--steel); }
.btn.is-active { color: var(--bone); background: var(--steel); }

/* ── Remplaçants des popups natives (static/ui.js) ─────────────── */
.tip { position: fixed; z-index: 100; display: none; max-width: 280px; padding: 6px 9px; pointer-events: none;
       background: var(--steel); color: var(--bone); border: 1px solid var(--filament-2); border-radius: var(--radius-sm);
       font-family: var(--font-mono); font-size: 11px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.tip-num { padding: 8px 12px 9px; }
.tip-num .tip-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ash); margin-bottom: 3px; }
.tip-num .tip-value { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--bone); letter-spacing: -.01em; }
.tip-num .tip-unit { font-family: var(--font-mono); font-size: 11px; color: var(--ash); }
.bars .bar:hover { background: var(--bone); }
.field-error { margin-top: 6px; font-size: 12px; color: var(--bad); }
.btn.btn-danger-solid { background: var(--bad); color: var(--ink); }
.btn.btn-danger-solid:hover:not(:disabled) { background: #FF6A67; }

/* ── Fenêtre modale (élément <dialog> natif : focus, Échap et fond gérés par le navigateur) ── */
.dialog {
  padding: 0; margin: auto; border: var(--hairline); border-radius: var(--radius);
  background: var(--ink); color: var(--bone);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5);
}
.dialog::backdrop { background: rgba(5, 5, 6, .72); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.dialog[open] { animation: pds-pop 200ms var(--ease); }
@keyframes pds-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
               padding: 20px 24px; border-bottom: var(--hairline); background: var(--graphite); }
.dialog-body { padding: 24px; }
.dialog-body > * + * { margin-top: 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px;
               border-top: var(--hairline); background: var(--graphite); }

/* Choix exclusif en carte (rôle d'un nouveau compte) ; sélection = braise */
.choice {
  display: block; width: 100%; text-align: left; padding: 14px 16px; cursor: pointer;
  border: var(--hairline); border-radius: var(--radius); background: var(--graphite); color: var(--ash);
  font-size: 13px; line-height: 1.5; transition: border-color var(--t-fast), background var(--t-fast);
}
.choice:hover { border-color: var(--filament-2); }
.choice[aria-pressed="true"] { border-color: var(--ember); background: var(--ember-a); }
.choice-title { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 12px;
                letter-spacing: .08em; text-transform: uppercase; color: var(--bone); }

/* ── Tiroir latéral (détail d'un événement) ──────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 6, .72);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(760px, 100vw); display: flex; flex-direction: column;
  background: var(--ink); border-left: var(--hairline);
  transform: translateX(100%); visibility: hidden;
  transition: transform 320ms var(--ease), visibility 0s linear 320ms;
  box-shadow: -40px 0 80px rgba(0, 0, 0, .45);
}
.drawer-open .scrim  { opacity: 1; pointer-events: auto; }
.drawer-open .drawer { transform: translateX(0); visibility: visible; transition: transform 320ms var(--ease), visibility 0s; }
.drawer-head { padding: 22px 28px 20px; border-bottom: var(--hairline); background: var(--graphite); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }
.drawer-body > * + * { margin-top: 20px; }
body.drawer-open { overflow: hidden; }

/* ── Chargement ──────────────────────────────────────────────── */
.spin { width: 14px; height: 14px; border: 2px solid var(--filament-2); border-top-color: var(--ember); border-radius: 50%; animation: pds-spin .8s linear infinite; }
@keyframes pds-spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--steel) 0%, var(--filament) 50%, var(--steel) 100%); background-size: 200% 100%; animation: pds-shimmer 1.4s linear infinite; border-radius: var(--radius-sm); }
@keyframes pds-shimmer { to { background-position: -200% 0; } }

/* ── Barre supérieure ────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 11, 12, .82);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: var(--hairline);
}

/* ── Bloc de code (page /design) ─────────────────────────────── */
.code {
  background: var(--ink); border: var(--hairline); border-radius: var(--radius);
  padding: 20px 24px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.9; color: var(--bone);
  overflow-x: auto; white-space: pre;
}
.code .k { color: var(--ember); }
.code .c { color: var(--smoke); }

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

@media (max-width: 639px) {
  .table th, .table td { padding-left: 14px; padding-right: 14px; }
  .drawer-head { padding: 18px 18px 16px; }
  .drawer-body { padding: 18px 16px 32px; }
  .search .field { padding-right: 16px; }
}
