/* ═══════════════════════════════════════════════════════════════════════════
   Design « Ardoise » — minimal pro, clair, accent indigo
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #eef1f6;
  --bg-grad: linear-gradient(160deg, #eef1f6, #e4e8f0);
  --surface: #ffffff;
  --ink: #1e2530;
  --muted: #7a8598;
  --border: #dde3ec;
  --input-bg: #f6f8fb;
  --accent: #3b5bdb;
  --accent-ink: #2f4bc0;
  --danger: #d64550;
  --ok: #1f9d6b;
  --radius: 12px;
  --shadow: 0 18px 40px -24px rgba(30, 45, 90, .35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
/* min-height (pas height:100%) : height:100% sur html/body casse position:sticky
   de la barre de navigation (le scroll n’est plus celui du viewport). */
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Overlay plein écran (Firefox / Safari / Chrome) ───────────────────────
   Évite le bug Firefox « fixed enfant de flex / overflow:clip » qui colle
   la modal en bas. Appliquer aussi aux overlays métier critiques. */
.lpe-overlay,
.access-denied-modal,
.changelog-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0;
  box-sizing: border-box;
  z-index: 10000;
}
.lpe-overlay__backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(15, 23, 42, .5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
a { color: var(--accent); }
h1, h2 { letter-spacing: -.02em; text-wrap: balance; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.ta-r { text-align: right; }

/* ─── Champs & boutons communs ───────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: #48505f; }
.field label .opt { font-weight: 400; color: var(--muted); }
input {
  width: 100%; font: inherit; font-size: 14px; padding: 11px 13px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--input-bg);
  color: var(--ink); outline: none; transition: border-color .12s, box-shadow .12s;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  max-width: none;
  height: auto;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 0 0 auto;
  accent-color: var(--accent, #3b5bdb);
}
input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(59, 91, 219, .16); }
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  background: transparent;
  box-shadow: none;
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  padding: 12px 16px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; transition: background .12s;
}
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary.inline { display: inline-block; width: auto; text-decoration: none; }
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-mini:focus-visible,
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Écran d'authentification (login / register / install) ──────────────── */
body.v-auth { background: var(--bg-grad); }
.auth-main { min-height: 100%; display: grid; place-items: center; padding: 32px 20px; }
.auth-card {
  width: 100%; max-width: 360px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 26px; box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 440px; }
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-row--logo {
  justify-content: center;
  width: 112px;
  height: 112px;
  margin: 0 auto;
  border-radius: 50%;
  background: #000;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.auth-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #000;
}
.auth-logo, .brand-logo {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  background: var(--accent); color: #fff;
}
.auth-brand { font-weight: 700; font-size: 16px; }
.auth-sub { font-size: 12px; color: var(--muted); }
.auth-title { font-size: 19px; margin: 20px 0 2px; }
.auth-lead { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin: 16px 0 0; }
.auth-foot a { font-weight: 600; text-decoration: none; }

.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab {
  flex: 1; text-align: center; text-decoration: none; font-size: 13px; font-weight: 600;
  color: var(--muted); padding: 9px; border-radius: 8px;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(30, 45, 90, .12); }

/* ─── Barre de navigation (bannière + menu dessous) ───────────────────────── */
body.v-app {
  --nav-banner-h: 106px;
  --nav-menu-h: 52px;
  /* Fallback ; nav-offset.js remplace par la hauteur mesurée (anti-chevauchement). */
  --nav-offset: calc(var(--nav-banner-h) + var(--nav-menu-h));
  --caisse-nav-offset: var(--nav-offset);
  --hx-nav-offset: var(--nav-offset);
  /* Réserve l’espace sous la barre fixed (logo + menu). */
  padding-top: var(--nav-offset);
}
.navbar {
  /* fixed : reste visible sur toute la hauteur de page (sticky était cassé). */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-top {
  max-width: none;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 22px;
  box-sizing: border-box;
  min-height: var(--nav-banner-h);
}
/* Keep topnav full-bleed even if a page stylesheet caps content width. */
html body.v-app .navbar > .nav-top {
  max-width: none;
  width: 100%;
}
.nav-menu-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 14px 6px;
  min-height: var(--nav-menu-h);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  /* Important: pas d’overflow-x ici — en CSS, overflow-x ≠ visible force
     overflow-y en auto et coupe les dropdowns des rubriques. */
  overflow: visible;
  position: relative;
  z-index: 51;
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  flex: 0 0 auto;
  line-height: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #000;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.nav-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #000;
}
/* Ancien badge « É » (thèmes festifs) — conservé si réutilisé ailleurs */
.nav-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-size: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), #6d7bff);
  box-shadow: 0 6px 16px -6px rgba(59, 91, 219, .6);
}
.nav-brand-text { font-size: 15px; letter-spacing: -.01em; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  flex-wrap: nowrap;
  overflow: visible;
  padding: 2px;
}
/* Scroll horizontal sans couper les dropdowns : actif seulement hors panneau ouvert */
.nav-links.nav-rail-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.nav-rail {
  border-radius: 12px;
}

/* Bannière pub IAB Leaderboard 728×90 — entre logo et outils droite */
.nav-ad {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  max-width: 728px;
  margin: 0 10px;
}
.nav-ad-frame {
  position: relative;
  width: 100%;
  max-width: 728px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 80%, var(--surface));
  border: 1px dashed color-mix(in srgb, var(--border) 70%, var(--muted));
  box-sizing: border-box;
}
.nav-ad-frame.has-content {
  border-style: solid;
  border-color: var(--border);
  background: #0e1626;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}
.nav-ad-flag {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(15, 23, 42, .55);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}
.nav-ad-media {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.nav-ad-track { position: absolute; inset: 0; }
.nav-ad-slide {
  position: absolute;
  inset: 0;
  /* Bannières composées en 1920×112/132 : coller à gauche (contenu utile ~62 %) */
  background-size: auto 100%;
  background-position: left center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity .7s ease;
}
.nav-ad-slide.is-on { opacity: 1; }
.nav-ad-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 100%;
  padding: 10px 16px 10px 48px;
  background: linear-gradient(120deg, #1d4ed8, #2563eb 55%, #3b82f6);
  color: #fff;
  box-sizing: border-box;
}
.nav-ad-text strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-ad-text span {
  font-size: 12px;
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-ad-cta {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #1e3a8a;
  background: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
}
.nav-ad-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.nav-ad-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}
.nav-ad-placeholder small {
  font-size: 10px;
  font-weight: 700;
  opacity: .7;
  letter-spacing: .04em;
}

/* Compat anciens liens texte */
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 10px; border-radius: 10px; transition: color .12s, background .12s;
}
.nav-link svg { width: 17px; height: 17px; opacity: .85; }
.nav-link:hover { color: var(--ink); background: var(--bg); }
.nav-link.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Rail d’icônes (esprit Stock) */
.nav-ico-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
  flex-shrink: 0;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .1s ease;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.nav-ico-btn .nav-ico-glyph {
  display: grid;
  place-items: center;
  line-height: 0;
  flex-shrink: 0;
}
.nav-ico-btn .nav-ico-glyph svg { display: block; }
.nav-ico-btn .nav-ico-label {
  max-width: 5.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-ico-btn .nav-chevron {
  width: 12px;
  height: 12px;
  opacity: .65;
  flex-shrink: 0;
  margin-left: -1px;
}
.nav-ico-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .1);
}
.nav-ico-btn:active { transform: translateY(0); }
.nav-ico-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-ico-btn.is-active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.nav-tone-indigo { background: #eef2ff; border-color: #c7d2fe; color: #312e81; }
.nav-tone-indigo:hover { background: #e0e7ff; border-color: #a5b4fc; }
.nav-tone-teal { background: #f0fdfa; border-color: #99f6e4; color: #115e59; }
.nav-tone-teal:hover { background: #ccfbf1; border-color: #5eead4; }
.nav-tone-emerald { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.nav-tone-emerald:hover { background: #d1fae5; border-color: #6ee7b7; }
.nav-tone-violet { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.nav-tone-violet:hover { background: #ede9fe; border-color: #c4b5fd; }
.nav-tone-rose { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.nav-tone-rose:hover { background: #ffe4e6; border-color: #fda4af; }
.nav-tone-amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.nav-tone-amber:hover { background: #fef3c7; border-color: #fcd34d; }
.nav-tone-orange { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.nav-tone-orange:hover { background: #ffedd5; border-color: #fdba74; }
.nav-tone-cyan { background: #ecfeff; border-color: #a5f3fc; color: #155e75; }
.nav-tone-cyan:hover { background: #cffafe; border-color: #67e8f9; }
.nav-tone-sky { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.nav-tone-sky:hover { background: #e0f2fe; border-color: #7dd3fc; }
.nav-tone-lime { background: #f7fee7; border-color: #d9f99d; color: #3f6212; }
.nav-tone-lime:hover { background: #ecfccb; border-color: #bef264; }
.nav-tone-pink { background: #fdf2f8; border-color: #fbcfe8; color: #9d174d; }
.nav-tone-pink:hover { background: #fce7f3; border-color: #f9a8d4; }
.nav-tone-fuchsia { background: #fdf4ff; border-color: #f5d0fe; color: #86198f; }
.nav-tone-fuchsia:hover { background: #fae8ff; border-color: #f0abfc; }
.nav-tone-slate { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
.nav-tone-slate:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* Caisse de secours — icône seule en barre (hors rubrique) */
.nav-link-caisse {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  gap: 0;
  border-color: #fdba74;
  background: #fff7ed;
}
.nav-link-caisse .nav-ico-label { display: none; }
.nav-link-caisse:hover {
  background: #ffedd5;
  border-color: #fb923c;
}
.nav-link-caisse.is-active {
  background: #fdba74;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ea580c 30%, transparent);
}
.nav-link-caisse.is-mode-active {
  background: #fee2e2;
  border-color: #fca5a5;
  animation: nav-caisse-pulse 2s ease-in-out infinite;
}
.nav-link-caisse.is-mode-active.is-active {
  background: #fecaca;
  border-color: #f87171;
  animation: none;
}
@keyframes nav-caisse-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, #dc2626 0%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, #dc2626 22%, transparent); }
}

.nav-burger {
  display: none; margin-left: auto; width: 36px; height: 34px; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); cursor: pointer;
}
.nav-burger svg { width: 18px; height: 18px; }

.nav-user {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  z-index: 52;
}
.nav-app-version {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: help;
}
.nav-app-version:hover,
.nav-app-version:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent, #4f46e5) 35%, var(--border));
}
.nav-version-tip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
  white-space: normal;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.nav-version-tip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 14px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.nav-app-version:hover .nav-version-tip,
.nav-app-version:focus-visible .nav-version-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-version-tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.nav-version-tip-head strong {
  font-size: 12px;
  font-weight: 800;
}
.nav-version-tip-date {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.nav-version-tip ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 12px;
  line-height: 1.4;
}
.nav-version-tip li { margin-bottom: 6px; }
.nav-version-tip li:last-child { margin-bottom: 0; }
.nav-avatar-btn {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 5px 8px 5px 5px;
  font: inherit; color: var(--ink); transition: background .12s, border-color .12s;
}
.nav-avatar-btn:hover { background: var(--bg); border-color: var(--border); }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
}
.nav-avatar.lg { width: 42px; height: 42px; font-size: 15px; }
.nav-user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.nav-user-name { font-size: 13.5px; font-weight: 600; }
.nav-user-role { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.nav-chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .18s; }
.nav-avatar-btn[aria-expanded="true"] .nav-chevron,
.nav-rubrique-toggle[aria-expanded="true"] .nav-chevron,
.nav-rubrique.is-open .nav-chevron { transform: rotate(180deg); }

.nav-rubrique { position: relative; flex: 0 0 auto; }
/* Pont invisible sous le bouton : évite de perdre le hover en rejoignant le panneau. */
.nav-rubrique::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: 100%;
  height: 16px;
  z-index: 10;
  display: none;
}
.nav-rubrique:hover::after,
.nav-rubrique.is-open::after {
  display: block;
}
.nav-rubrique-toggle {
  font: inherit; cursor: pointer;
}
.nav-rubrique-toggle.nav-ico-btn .nav-chevron { width: 12px; height: 12px; opacity: .7; }
.nav-rubrique-panel {
  position: absolute; left: 0; top: 100%; min-width: 240px;
  /* padding-top = espace visuel inclus dans la zone hover (pas de trou). */
  padding: 14px 6px 6px;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  z-index: 70;
  opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
  /* Ne pas animer pointer-events : un délai à l’ouverture rend le panneau « fantôme »
     et le sous-menu se ferme dès qu’on bouge la souris vers lui. */
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
/* Carte visuelle du sous-menu (fond / bordure / ombre). */
.nav-rubrique-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 44px -20px rgba(15, 23, 42, .4);
  z-index: 0;
  pointer-events: none;
}
.nav-rubrique-panel > * {
  position: relative;
  z-index: 1;
}
.nav-rubrique.is-open .nav-rubrique-panel {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
  .nav-rubrique:hover .nav-rubrique-panel {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
  }
}

.nav-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 280px; max-height: min(78vh, 560px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 20px 44px -20px rgba(15, 23, 42, .4); z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s;
}
.nav-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; }
.nav-menu-id { min-width: 0; }
.nav-menu-id .nn { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.nav-menu-id .ne { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-menu-version {
  display: none;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 4px 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent, #4f46e5) 6%, var(--bg, #f8fafc));
  font-size: 12px;
  line-height: 1.3;
}
.nav-menu-version-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  width: 100%;
}
.nav-menu-version-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.nav-menu-version-date {
  font-size: 11px;
  color: var(--muted);
}
.nav-menu-section {
  display: block; padding: 10px 11px 3px; margin-top: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.nav-menu-section:first-of-type,
.nav-menu-head + .nav-menu-section { margin-top: 0; }
.nav-menu-item {
  display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink);
  font-size: 13.5px; font-weight: 500; padding: 7px 10px; border-radius: 9px;
}
.nav-menu-item:hover { background: var(--bg); }
.nav-menu-item.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.nav-menu-item.danger { color: var(--danger); }
.nav-menu-item.danger:hover { background: #fdecee; }
.nav-menu-ico {
  display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid transparent; line-height: 0;
}
.nav-menu-ico svg { width: 16px; height: 16px; display: block; }
.nav-menu-ico.nav-tone-indigo { background: #eef2ff; border-color: #c7d2fe; }
.nav-menu-ico.nav-tone-teal { background: #f0fdfa; border-color: #99f6e4; }
.nav-menu-ico.nav-tone-emerald { background: #ecfdf5; border-color: #a7f3d0; }
.nav-menu-ico.nav-tone-violet { background: #f5f3ff; border-color: #ddd6fe; }
.nav-menu-ico.nav-tone-rose { background: #fff1f2; border-color: #fecdd3; }
.nav-menu-ico.nav-tone-amber { background: #fffbeb; border-color: #fde68a; }
.nav-menu-ico.nav-tone-orange { background: #fff7ed; border-color: #fed7aa; }
.nav-menu-ico.nav-tone-cyan { background: #ecfeff; border-color: #a5f3fc; }
.nav-menu-ico.nav-tone-sky { background: #f0f9ff; border-color: #bae6fd; }
.nav-menu-ico.nav-tone-lime { background: #f7fee7; border-color: #d9f99d; }
.nav-menu-ico.nav-tone-pink { background: #fdf2f8; border-color: #fbcfe8; }
.nav-menu-ico.nav-tone-fuchsia { background: #fdf4ff; border-color: #f5d0fe; }
.nav-menu-ico.nav-tone-slate { background: #f8fafc; border-color: #e2e8f0; }
.nav-menu-label { min-width: 0; }
.nav-menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

.nav-impersonate-form { padding: 4px 6px 8px; }
.nav-impersonate-label {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--ink);
  margin: 0 0 6px; padding: 4px 5px 0;
}
.nav-impersonate-row { display: flex; gap: 6px; align-items: center; padding: 0 5px; }
.nav-impersonate-row select {
  flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 7px 9px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--input-bg); color: var(--ink);
}
.nav-impersonate-empty {
  margin: 0; padding: 0 5px 4px; font-size: 12px; line-height: 1.35; color: var(--muted);
}
.nav-menu-btn {
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
  font: inherit; color: var(--accent); font-weight: 600;
}
.nav-menu-btn:hover { background: var(--bg); }

.impersonate-banner {
  position: sticky; top: var(--nav-offset, calc(var(--nav-banner-h, 106px) + var(--nav-menu-h, 52px))); z-index: 45;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 500; color: #5c4813;
  background: #fff6d6; border-bottom: 1px solid #ecd889;
}
.impersonate-banner strong { font-weight: 700; }
.impersonate-banner-form { margin: 0; }
.impersonate-banner-btn {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 5px 12px; border-radius: 8px; border: 1px solid #d4b74a;
  background: #fff; color: #5c4813;
}
.impersonate-banner-btn:hover { background: #fffbeb; border-color: #b8962e; }

@media (max-width: 1280px) {
  .nav-ad { max-width: 468px; }
  .nav-ad-frame { height: 60px; max-width: 468px; }
  body.v-app {
    --nav-banner-h: 76px;
    --nav-offset: calc(var(--nav-banner-h) + var(--nav-menu-h));
  }
  .nav-brand { width: 60px; height: 60px; }
}
@media (max-width: 1100px) {
  .nav-ad { display: none; }
}

@media (max-width: 720px) {
  body.v-app {
    --nav-banner-h: 76px;
    --nav-menu-h: 48px;
    --nav-offset: calc(var(--nav-banner-h) + var(--nav-menu-h));
  }
  .nav-top { min-height: 76px; padding: 6px 14px; }
  .nav-brand { width: 64px; height: 64px; }
  .nav-ad { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-menu-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    min-height: var(--nav-menu-h);
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .nav-links,
  .nav-links.nav-rail-scroll {
    overflow: visible;
    flex-direction: column; align-items: stretch; gap: 8px; flex-wrap: nowrap;
    min-width: 0; width: 100%;
    margin: 0; padding: 8px; border-radius: 0;
    box-shadow: 0 16px 30px -18px rgba(15, 23, 42, .4);
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 55;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links > .nav-link,
  .nav-links > .nav-ico-btn { width: 100%; justify-content: flex-start; }
  .nav-rubrique { width: 100%; }
  .nav-rubrique::after { display: none !important; }
  .nav-rubrique-toggle { width: 100%; justify-content: flex-start; }
  .nav-rubrique-toggle .nav-chevron { margin-left: auto; }
  .nav-rubrique-panel {
    position: static;
    /* Pas de margin quand fermé : sinon l’écart Accueil→Quotidien manque
       (Accueil n’a pas de panneau, les rubriques oui). */
    margin-top: 0;
    padding: 0 6px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: none;
    opacity: 0; visibility: hidden; max-height: 0; overflow: hidden;
    transform: none; pointer-events: none; transition: none;
  }
  .nav-rubrique-panel::after { display: none; }
  /* Mobile: click/tap only — ignore desktop hover open */
  .nav-rubrique:hover .nav-rubrique-panel {
    opacity: 0; visibility: hidden; max-height: 0; pointer-events: none;
  }
  .nav-rubrique.is-open .nav-rubrique-panel {
    opacity: 1; visibility: visible; max-height: none; overflow: visible; pointer-events: auto;
    margin-top: 6px;
    padding: 6px;
  }
  .nav-user { margin-left: auto; }
  .nav-user-meta { display: none; }
}

/* ─── Contenu applicatif ─────────────────────────────────────────────────── */
body.v-app .app-main {
  max-width: none !important;
  width: 100%;
  margin: 0;
  padding: 16px 22px 40px;
  box-sizing: border-box;
  overflow-x: hidden;
}
@media (max-width: 720px) {
  body.v-app .app-main {
    padding: 12px 12px 32px;
  }
}

/* ─── Bandeau titre global (réf. Stock Hybrid — teal partout) ────────────── */
.page-top-banner {
  /* Fallback local ; themes.css remplace via --blue / --teal */
  --ptb-grad: linear-gradient(135deg, var(--blue-deep, var(--accent-ink, #07665c)) 0%, var(--blue, var(--accent, #0d8a7c)) 52%, var(--teal, #1aa99a) 100%);
  --ptb-shadow: 0 14px 32px -18px color-mix(in srgb, var(--blue-deep, var(--accent-ink, #07665c)) 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: var(--ptb-shadow);
  margin: 2px 0 16px;
  background: var(--ptb-grad);
}

/* Alias historiques : même fond Stock (plus de tons par rubrique) */
.page-top-banner--teal,
.page-top-banner--indigo,
.page-top-banner--blue,
.page-top-banner--violet,
.page-top-banner--emerald,
.page-top-banner--slate {
  background: var(--ptb-grad);
  box-shadow: var(--ptb-shadow);
}

.ptb-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ptb-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 1.15rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px);
}

.ptb-copy { min-width: 0; }
.ptb-copy h1 {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(1.15rem, 1.8vw, 1.75rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
}

.ptb-copy p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .88);
  font-size: .9rem;
  line-height: 1.35;
  white-space: normal;
}

.ptb-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ptb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 13px;
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}

a.ptb-btn,
a.ptb-btn:visited,
a.ptb-btn:hover,
a.ptb-btn:active {
  color: #fff;
  text-decoration: none;
}

.ptb-btn:hover {
  background: rgba(255, 255, 255, .26);
  color: #fff;
}

.ptb-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .9);
  outline-offset: 2px;
}

.ptb-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .28);
  box-shadow: none;
}

.ptb-btn--ghost:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .42);
}

.ptb-btn--primary {
  background: #fff;
  border-color: #fff;
  color: var(--blue-deep, var(--accent-ink, #0b4f48));
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .28);
  font-weight: 700;
}

a.ptb-btn--primary,
a.ptb-btn--primary:visited {
  color: var(--blue-deep, var(--accent-ink, #0b4f48));
}

.ptb-btn--primary:hover {
  background: color-mix(in srgb, var(--blue, var(--accent, #0d8a7c)) 6%, #fff);
  border-color: #fff;
  color: var(--blue-deep, var(--accent-ink, #083f39));
}

a.ptb-btn--primary:hover,
a.ptb-btn--primary:active {
  color: var(--blue-deep, var(--accent-ink, #083f39));
}

.ptb-btn-icon {
  width: 36px;
  min-width: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, .14);
  border-color: transparent;
}

@media (max-width: 780px) {
  .page-top-banner {
    flex-wrap: wrap;
    padding: 14px;
    border-radius: 14px;
  }

  .ptb-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .ptb-copy p {
    font-size: .84rem;
  }
}

@media (max-width: 420px) {
  .page-top-banner {
    padding: 12px;
    gap: 12px;
  }
  .ptb-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .ptb-copy h1 {
    font-size: 1.05rem;
  }
  .ptb-btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: .82rem;
  }
}

/* Titre porté par .page-top-banner — masquer les doublons / sous-textes locaux */
body.v-app .page-head > div > h1,
body.v-app .page-head > div > p,
body.v-app .page-head.adm-page-head h1,
body.v-app .page-head.usr-page-head h1,
body.v-app .page-head.perm-page-head h1,
body.v-app .page-head.dash8-head h1,
body.v-app .adm-hero,
body.v-app .sv2-hero .sv2-hero-icon,
body.v-app .sv2-hero .sv2-hero-copy,
body.v-app .notes-hero,
body.v-app .inv-mc-top > div:first-child:has(h1),
body.v-app .cx-page-head-main h1,
body.v-app .cx-page-head-main p,
body.v-app .mg-page-head > div > h1,
body.v-app .mg-page-head > div > p,
body.v-app .da-page-head > div > h1,
body.v-app .da-page-head > div > p,
body.v-app .zc-page-head > div > h1,
body.v-app .zc-page-head > div > p,
body.v-app .fdc-page-head h1,
body.v-app .fdc-page-head p,
body.v-app .absvc-page-head > div > h1,
body.v-app .absvc-page-head > div > p,
body.v-app .dupf-page-head > div > h1,
body.v-app .dupf-page-head > div > p {
  display: none !important;
}

/* Heroes locaux : ne gardent que KPIs / actions sous le bandeau */
body.v-app .sv2-hero {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  top: 0 !important;
}
body.v-app .sv2-hero-actions,
body.v-app .av2-hero-kpis-wrap {
  margin-left: auto;
}
body.v-app .av2-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; margin: 0 0 4px; }
.page-head p { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.card-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.card-value.small { font-size: 15px; font-weight: 600; }

.panel { margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.panel h2 { font-size: 17px; margin: 0 0 4px; }
.panel p { margin: 0 0 16px; }

/* ─── Tableau (admin) ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.grid-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.grid-table th, .grid-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.grid-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: #f8fafc; }
.grid-table tbody tr:last-child td { border-bottom: none; }
.grid-table tbody tr:hover { background: #f9fbfe; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff;
}
.badge.soft { background: #e7ebf3; color: #5a6577; }

.btn-mini {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border);
  background: #fff; color: var(--ink);
}
.btn-mini:hover { border-color: var(--muted); }
.btn-mini.danger { color: var(--danger); border-color: #f0cdd0; }
.btn-mini.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════════
   Dashboard « SaaS clair » (design 08) — cartes à liseré + sparklines
   ═══════════════════════════════════════════════════════════════════════════ */
.dash8-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash8-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #0f7a52;
  background: #e6f6ef; border: 1px solid #bfe6d3; padding: 6px 12px; border-radius: 999px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }

.dash8-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.dash8-btn-ico { font-size: 14px; line-height: 1; opacity: .92; }
.dash8-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 80%, #0f172a);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.dash8-btn-primary:hover {
  background: var(--accent-ink);
  color: #fff;
  text-decoration: none;
}
.dash8-btn-secondary {
  background: var(--surface, #fff);
  color: var(--ink, #0f172a);
  border-color: var(--border, #d7dee8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.dash8-btn-secondary:hover {
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border, #d7dee8));
  color: var(--accent-ink, var(--accent));
  text-decoration: none;
}
.dash8-btn-slate {
  background: #475569;
  color: #fff;
  border-color: #334155;
}
.dash8-btn-slate:hover {
  background: #334155;
  color: #fff;
  text-decoration: none;
}
.dash8-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.kpi8-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 780px) { .kpi8-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi8 { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; }
.kpi8::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.kpi8.a::before { background: #3b82f6; } .kpi8.b::before { background: #10b981; }
.kpi8.c::before { background: #f59e0b; } .kpi8.d::before { background: #8b5cf6; }
.kpi8 .k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi8 .v { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi8 .sub { font-size: 12px; color: var(--muted); }
.kpi8 svg.spark { display: block; width: 100%; height: 32px; margin-top: 10px; }
.kpi8-badges { display: flex; gap: 8px; margin-top: 12px; }
.mini-badge { font-size: 12px; font-weight: 600; color: #5a6577; background: var(--bg); border: 1px solid var(--border);
  padding: 4px 9px; border-radius: 8px; }

.dash8-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 780px) { .dash8-row { grid-template-columns: 1fr; } }
.dash8-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.dash8-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dash8-card-head h2 { font-size: 15.5px; margin: 0; }
.dash8-card-head .small { font-size: 12px; }
.dash8-chart { display: block; width: 100%; height: 150px; }
.dash8-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-top: 4px; }
.trend-badge { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; }
.trend-badge.up { color: #0f7a52; background: #e6f6ef; } .trend-badge.down { color: #b3261e; background: #fdecee; }
.trend-badge .trend-cap { font-size: 11px; font-weight: 500; opacity: .8; }

.top8-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.top8-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.top8-name { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.top8-rank { width: 18px; height: 18px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--accent); border-radius: 6px; }
.top8-ca { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.top8-bar { height: 7px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 6px 0 3px; }
.top8-bar span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #3b82f6); border-radius: 999px; }
.top8-q { font-size: 11.5px; color: var(--muted); }

.dash8-adminbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ─── Messages flash ─────────────────────────────────────────────────────── */
.flash { padding: 11px 14px; border-radius: 9px; font-size: 13.5px; margin-bottom: 14px; border: 1px solid transparent; transition: opacity .4s ease, transform .4s ease, margin .4s ease, padding .4s ease; }
.flash.is-hiding { opacity: 0; transform: translateY(-6px); margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.flash-success { background: #e6f6ef; color: #146c4c; border-color: #bfe6d3; }
.flash-error { background: #fdecee; color: #a3242f; border-color: #f5c9ce; }
.flash-info { background: #eaf0fd; color: #2f4bc0; border-color: #cdd9f7; }

/* Modal accès refusé (redirect depuis require_admin / permissions) */
body.access-denied-open { overflow: hidden; }
.access-denied-modal {
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: access-denied-in .18s ease;
}
.access-denied-modal.is-hiding {
  opacity: 0;
  transition: opacity .18s ease;
}
.access-denied-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(15, 23, 42, .48);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.access-denied-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 48px -20px rgba(15, 23, 42, .45);
  text-align: center;
}
.access-denied-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}
.access-denied-panel h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: -.02em;
}
.access-denied-panel p {
  margin: 0 0 16px;
  color: #486581;
  font-size: .95rem;
  line-height: 1.45;
}
.access-denied-panel .btn-primary {
  min-width: 8rem;
}
@keyframes access-denied-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Installeur ─────────────────────────────────────────────────────────── */
.config-list { display: flex; flex-direction: column; gap: 0; margin: 4px 0 18px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.config-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.config-list > div:last-child { border-bottom: none; }
.config-list dt { margin: 0; font-size: 13px; color: var(--muted); }
.config-list dd { margin: 0; font-size: 13px; font-weight: 600; }
.hint-box { background: #fff7ed; border: 1px solid #fbdcae; color: #9a5b1a; font-size: 13px; padding: 12px 14px; border-radius: 9px; margin-bottom: 14px; }
.hint-box pre, code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.hint-box pre { margin: 8px 0 0; padding: 9px 11px; background: #fff; border: 1px solid #f0d9b5; border-radius: 6px; overflow-x: auto; font-size: 12.5px; }
code { background: var(--input-bg); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }

/* ─── Modal nouveautés (changelog) ───────────────────────────────────────── */
.changelog-modal-overlay {
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity .3s ease;
}
.changelog-modal-content {
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 550px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
  overflow: hidden;
  animation: changelogSlideUp .35s cubic-bezier(0.16, 1, 0.3, 1);
}
.changelog-modal-header {
  background: linear-gradient(135deg, var(--blue-deep, var(--accent-ink, #0f172a)) 0%, var(--blue, var(--accent, #1e293b)) 100%);
  color: #fff;
  padding: 16px 24px;
}
.changelog-modal-title {
  font-weight: 700;
  font-size: 1.15rem;
}
.changelog-modal-body {
  padding: 22px 24px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.55;
}
.changelog-modal-body ul { margin: 0; padding-left: 1.2rem; }
.changelog-modal-body li { margin-bottom: 10px; }
.changelog-modal-body li:last-child { margin-bottom: 0; }
.changelog-modal-footer {
  padding: 14px 24px;
  background: var(--bg, #f8fafc);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.changelog-btn {
  background: var(--accent, #4f46e5);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}
.changelog-btn:hover { filter: brightness(1.05); }
.changelog-btn:active { transform: scale(0.98); }
@keyframes changelogSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .nav-app-version { display: none; }
  /* Sur mobile la version n’est plus dans la barre : on la montre dans le menu avatar. */
  .nav-menu-version { display: flex; }

  .access-denied-modal,
  .changelog-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .access-denied-panel,
  .changelog-modal-content {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 100%);
    border-radius: 18px 18px 0 0;
    overflow: auto;
  }
  .changelog-modal-header,
  .changelog-modal-body,
  .changelog-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .access-denied-panel .btn-primary,
  .changelog-btn {
    width: 100%;
  }
  .changelog-modal-footer {
    justify-content: stretch;
  }
}
