/* =================================================================
   SIDRASPHERE — Design System v1 (sidra.css)
   Chrome dark permanent + Workspace dual-mode (light/dark)
   Sidebar + Topbar + Hero : signature "premium" stable.
   Workspace content : lisibilité variable selon thème.

   Extrait de app/index-v2.html (archive V0.0) pour V0.1.
   ================================================================= */

/* ============== 1. RESET ============== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
/* L'attribut HTML `hidden` doit TOUJOURS gagner sur les `display:` posés
   via classes (sinon les boutons / cards / nav-items en .btn /
   .card-grid / etc. restent visibles malgré l'attribut). */
[hidden] { display: none !important; }

/* ============== 2. CHROME TOKENS (fixes — sidebar/topbar/theme-pill) ============== */
:root {
  --chrome-bg:           #181438;
  --chrome-bg-hover:     rgba(255, 255, 255, 0.06);
  --chrome-bg-active:    rgba(255, 255, 255, 0.10);
  --chrome-text:         #E2E0F2;
  --chrome-text-strong:  #FFFFFF;
  --chrome-text-muted:   rgba(255, 255, 255, 0.62);   /* AA : ~5.2:1 sur #181438 */
  --chrome-text-whisper: rgba(255, 255, 255, 0.50);   /* AA Large : ~3.5:1 */
  --chrome-border:       rgba(255, 255, 255, 0.08);
  --chrome-border-strong:rgba(255, 255, 255, 0.16);
  --chrome-input-bg:     rgba(255, 255, 255, 0.06);
  --chrome-input-border: rgba(255, 255, 255, 0.10);

  --violet:           #7C3AED;
  --violet-light:     #A78BFA;
  --violet-soft:      rgba(124, 58, 237, 0.08);
  --magenta:          #DB2777;
  --magenta-light:    #F472B6;
  --magenta-soft:     rgba(219, 39, 119, 0.08);
  --gradient-accent:  linear-gradient(135deg, #7C3AED 0%, #DB2777 100%);
  --gradient-accent-light: linear-gradient(135deg, #A78BFA 0%, #F472B6 100%);

  --serif: 'Instrument Serif', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:  'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
  --t-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:  280ms cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 260px;
  --topbar-h:  56px;
}

/* ============== 3. WORKSPACE TOKENS — LIGHT (clinical) ============== */
:root {
  color-scheme: light;

  --bg-app:           #FFFFFF;
  --bg-app-alt:       #F8FAFC;
  --bg-card:          #FFFFFF;
  --bg-card-hover:    #FAFAFC;
  --bg-input:         #FFFFFF;
  --bg-pill:          #F1F5F9;

  --text-strong:      #0F172A;
  --text-primary:     #1E293B;
  --text-secondary:   #475569;     /* AA : 7.4:1 sur blanc */
  --text-muted:       #64748B;     /* AA : 4.8:1 sur blanc */
  --text-whisper:     #6B7A91;     /* AA Large : 4.4:1 sur blanc */

  --border:           #E2E8F0;
  --border-soft:      #F1F5F9;
  --border-strong:    #CBD5E1;

  --success:          #16A34A;
  --success-soft:     rgba(22, 163, 74, 0.10);
  --warning:          #D97706;
  --warning-soft:     rgba(217, 119, 6, 0.12);
  --danger:           #DC2626;
  --danger-soft:      rgba(220, 38, 38, 0.10);

  --shadow-sm:        0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:        0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg:        0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-pop:       0 24px 48px -12px rgba(15, 23, 42, 0.18);

  --card-hover-glow:
    0 0 0 1px rgba(124, 58, 237, 0.10),
    0 16px 40px -10px rgba(124, 58, 237, 0.20),
    0 28px 60px -18px rgba(236, 72, 153, 0.15);

  --glass-blur: none;

  /* Hero : look premium violet/magenta foncé, identique en light et dark
     (continuité visuelle avec sidebar+topbar) */
  --hero-bg:
    radial-gradient(ellipse 720px 480px at 88% -10%, rgba(192, 132, 252, 0.48), transparent 60%),
    radial-gradient(ellipse 620px 460px at 10% 110%, rgba(244, 114, 182, 0.42), transparent 60%),
    radial-gradient(ellipse 400px 280px at 50% 50%, rgba(167, 139, 250, 0.12), transparent 70%),
    linear-gradient(135deg, #1A0E3F 0%, #2D1163 30%, #4C1D6E 60%, #6B1844 100%);
  --hero-border: rgba(255, 255, 255, 0.12);
  --hero-text-strong: #FFFFFF;
  --hero-text:        rgba(255, 255, 255, 0.78);
  --hero-lede:        rgba(255, 255, 255, 0.82);
  --hero-spotlight:   rgba(255, 255, 255, 0.08);
}

/* ============== 4. WORKSPACE TOKENS — DARK (immersive gradient + glass) ============== */
[data-theme="dark"] {
  color-scheme: dark;

  --bg-app:           transparent;  /* gradient sur body */
  --bg-app-alt:       transparent;
  --bg-card:          rgba(255, 255, 255, 0.05);
  --bg-card-hover:    rgba(255, 255, 255, 0.08);
  --bg-input:         rgba(255, 255, 255, 0.05);
  --bg-pill:          rgba(255, 255, 255, 0.06);

  --text-strong:      #FFFFFF;
  --text-primary:     #F1F5F9;
  --text-secondary:   #CBD5E1;
  --text-muted:       #A3B0C2;
  --text-whisper:     #8290A6;

  --border:           rgba(255, 255, 255, 0.08);
  --border-soft:      rgba(255, 255, 255, 0.04);
  --border-strong:    rgba(255, 255, 255, 0.16);

  --success:          #4ADE80;
  --success-soft:     rgba(74, 222, 128, 0.15);
  --warning:          #FBBF24;
  --warning-soft:     rgba(251, 191, 36, 0.15);
  --danger:           #F87171;
  --danger-soft:      rgba(248, 113, 113, 0.15);

  --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow-md:        0 4px 16px rgba(0, 0, 0, 0.30);
  --shadow-lg:        0 16px 40px rgba(0, 0, 0, 0.40);
  --shadow-pop:       0 24px 60px -16px rgba(0, 0, 0, 0.60);

  --card-hover-glow:
    0 0 0 1px rgba(192, 132, 252, 0.25),
    0 16px 40px -8px rgba(192, 132, 252, 0.20),
    0 28px 70px -18px rgba(244, 114, 182, 0.15);

  --glass-blur: blur(24px) saturate(130%);
}

/* ============== 5. BODY + BACKGROUND ============== */
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-app);
  transition: color var(--t-med);
  min-height: 100vh;
}
[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 900px 700px at 85% -5%, rgba(192, 132, 252, 0.35), transparent 55%),
    radial-gradient(ellipse 800px 600px at 10% 110%, rgba(236, 72, 153, 0.30), transparent 55%),
    radial-gradient(ellipse 700px 500px at 50% 50%, rgba(99, 102, 241, 0.15), transparent 60%),
    linear-gradient(135deg, #0B0721 0%, #1E1340 25%, #3F1A6E 55%, #6B1854 85%, #781340 100%);
  background-attachment: fixed;
}

::selection { background: var(--magenta-soft); color: var(--magenta); }
[data-theme="dark"] ::selection { background: rgba(244, 114, 182, 0.30); color: #FFFFFF; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; border: 2px solid transparent; }

/* ============== 6. TYPOGRAPHIE ============== */
.h-hero {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(36px, 4.5vw, 52px);
  line-height: 1.05; letter-spacing: -0.02em;
}
.h-section { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--text-strong); }
.h-card    { font-size: 15.5px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--text-strong); }
.lede      { font-size: 16px; line-height: 1.55; color: var(--text-secondary); max-width: 60ch; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-muted);
}
.eyebrow.accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.meta {
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.text-muted { color: var(--text-muted); }
.text-strong { color: var(--text-strong); }

/* ============== 7. APP SHELL (topbar pleine largeur + sidebar dessous) ============== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  min-height: 100vh;
}

/* ============== 8. SIDEBAR (toujours dark + halos discrets) ============== */
.sidebar {
  grid-area: sidebar;
  background:
    radial-gradient(ellipse 360px 240px at 100% 0%, rgba(168, 85, 247, 0.22), transparent 60%),
    radial-gradient(ellipse 400px 320px at 0% 100%, rgba(236, 72, 153, 0.16), transparent 60%),
    var(--chrome-bg);
  border-right: 1px solid var(--chrome-border);
  color: var(--chrome-text);
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  display: flex; flex-direction: column;
}

/* .brand : conservée pour compatibilité (utilisée par auth-mark) — pas dans la sidebar. */
.brand {
  padding: var(--s-5) var(--s-5) var(--s-4);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--gradient-accent);
  display: inline-flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--serif); font-style: italic;
  font-size: 18px; font-weight: 500;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--serif); font-style: italic;
  font-size: 19px;
  color: var(--chrome-text-strong);
  letter-spacing: -0.01em;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--chrome-text-whisper);
  margin-top: 1px;
}

.nav { flex: 1; padding: var(--s-3); overflow-y: auto; }
.nav:empty { padding: var(--s-3); min-height: 80px; }

/* Catégorie cliquable (toggle collapse du groupe parent) */
.nav-cat {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--violet-light);
  padding: var(--s-5) var(--s-3) 6px;
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}
.nav-cat:hover { color: var(--chrome-text-strong); }
.nav-cat::after {
  content: '▾';
  font-size: 10px;
  opacity: 0.50;
  margin-left: 8px;
  transition: transform var(--t-fast);
}
.nav-group:first-child .nav-cat { padding-top: var(--s-3); }
.nav-group.is-collapsed .nav-cat::after { transform: rotate(-90deg); }
.nav-group.is-collapsed .nav-item { display: none !important; }

.nav-item {
  display: flex; align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin-left: 10px; /* indentation treeview discrète sous la catégorie */
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--chrome-text);
  transition: all var(--t-fast);
  cursor: pointer;
  position: relative;
  letter-spacing: -0.005em;
}
.nav-item:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-strong); }
.nav-item.is-active {
  background: var(--chrome-bg-active);
  color: var(--chrome-text-strong);
}
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--gradient-accent-light);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.40);
}
.nav-item .icon {
  width: 16px; height: 16px;
  color: var(--chrome-text-muted);
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.nav-item:hover .icon, .nav-item.is-active .icon { color: var(--chrome-text-strong); }
.nav-item-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Dot d'état retiré : tous les items affichés sont actifs depuis le nettoyage
   sidebar du lot RH-1. Classes conservées au cas où une distinction d'état
   serait nécessaire à l'avenir. */
.nav-status-dot { display: none; }

/* Theme pill (intégrée à la topbar) */
.theme-pill {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--chrome-input-bg);
  border: 1px solid var(--chrome-input-border);
  border-radius: var(--r-pill);
}
.theme-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--chrome-text-muted);
  transition: all var(--t-fast);
}
.theme-btn:hover { color: var(--chrome-text-strong); }
.theme-btn.active {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.45);
}
.theme-btn .icon { width: 12px; height: 12px; }

/* Avatar dans la topbar + son dropdown */
.topbar-avatar {
  padding: 2px;
  border-radius: 50%;
  transition: box-shadow var(--t-fast);
  margin-left: 4px;
}
.topbar-avatar:hover { box-shadow: 0 0 0 2px var(--chrome-bg-hover); }
.topbar-avatar.is-open { box-shadow: 0 0 0 2px var(--chrome-border-strong); }
.topbar-avatar-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: white;
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
}
.topbar-avatar-mark.has-photo { background: var(--bg-app-alt); }
.topbar-avatar-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* User dropdown menu */
.user-menu-backdrop { position: fixed; inset: 0; z-index: 70; }
.user-menu {
  position: fixed;
  top: calc(var(--topbar-h) + 6px);
  right: var(--s-6);
  z-index: 80;
  width: 280px;
  background: rgba(24, 20, 56, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.50), 0 0 0 1px rgba(192, 132, 252, 0.10);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  color: var(--chrome-text);
  overflow: hidden;
  animation: userMenuIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes userMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.user-menu-head {
  padding: 14px 16px 12px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.user-menu-mark {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.user-menu-mark.has-photo { background: rgba(255,255,255,0.10); }
.user-menu-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-menu-info { min-width: 0; line-height: 1.25; }
.user-menu-name {
  font-size: 14px; font-weight: 600;
  color: var(--chrome-text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-email {
  font-size: 12px; color: var(--chrome-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
.user-menu-role {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--violet-light);
  margin-top: 4px;
}
.user-menu-section { padding: 6px; }
.user-menu-section + .user-menu-section { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.user-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  color: var(--chrome-text);
  transition: background var(--t-fast);
  text-align: left;
}
.user-menu-item:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-strong); }
.user-menu-item .icon { width: 15px; height: 15px; color: var(--chrome-text-muted); }
.user-menu-item:hover .icon { color: var(--chrome-text-strong); }
.user-menu-item.danger { color: var(--magenta-light); }
.user-menu-item.danger .icon { color: var(--magenta-light); }
.user-menu-item.danger:hover { background: rgba(244, 114, 182, 0.10); color: var(--magenta-light); }
.user-menu-item-sub {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--chrome-text-whisper);
  letter-spacing: 0.08em;
}

/* ============== 9. TOPBAR (pleine largeur, intègre le brand à gauche) ============== */
.topbar {
  grid-area: topbar;
  height: var(--topbar-h);
  background:
    radial-gradient(ellipse 700px 80px at 60% 0%, rgba(168, 85, 247, 0.12), transparent 60%),
    var(--chrome-bg);
  border-bottom: 1px solid var(--chrome-border);
  display: flex; align-items: stretch;
  padding: 0;
  gap: 0;
  position: sticky; top: 0; z-index: 30;
  color: var(--chrome-text);
}

/* Bloc brand à gauche, largeur = largeur sidebar (continuité visuelle).
   Le border-right prolonge celui de la sidebar dessous. */
.topbar-brand {
  width: var(--sidebar-w);
  height: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--s-5);
  flex-shrink: 0;
  border-right: 1px solid var(--chrome-border);
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast);
}
.topbar-brand:hover { background: var(--chrome-bg-hover); text-decoration: none; }

/* Zone topbar à droite du brand (breadcrumb + search + actions) */
.topbar-content {
  flex: 1;
  display: flex; align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-6);
  min-width: 0;
}
.topbar-search {
  flex: 1;
  max-width: 460px;
  display: flex; align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--chrome-input-border);
  border-radius: var(--r-md);
  background: var(--chrome-input-bg);
  transition: all var(--t-fast);
}
.topbar-search:focus-within {
  border-color: rgba(244, 114, 182, 0.50);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.15);
}
.topbar-search input {
  flex: 1; background: none; border: 0; outline: none;
  font-size: 13.5px;
  color: var(--chrome-text-strong);
  letter-spacing: -0.005em;
}
.topbar-search input::placeholder { color: var(--chrome-text-whisper); }
.topbar-search.is-disabled { opacity: 0.55; cursor: not-allowed; }
.topbar-search.is-disabled input { pointer-events: none; }
.topbar-search .icon { color: var(--chrome-text-muted); flex-shrink: 0; }
.kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  color: var(--chrome-text-muted);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }
.icon-btn-chrome {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--chrome-text-muted);
  transition: all var(--t-fast);
  position: relative;
}
.icon-btn-chrome:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-strong); }
.icon-btn-chrome .dot {
  position: absolute; top: 8px; right: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--magenta-light);
  border: 2px solid var(--chrome-bg);
  box-shadow: 0 0 4px rgba(244, 114, 182, 0.50);
}

/* ============== 10. MAIN ============== */
.main {
  grid-area: main;
  padding: var(--s-8) var(--s-10);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}
.main.is-entering { animation: pageIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============== 11. HERO (signature premium dans les 2 modes) ============== */
.hero {
  position: relative;
  padding: var(--s-8) var(--s-10);
  margin-bottom: var(--s-8);
  border-radius: var(--r-xl);
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  overflow: hidden;
  box-shadow: 0 16px 48px -12px rgba(76, 29, 149, 0.30), 0 4px 12px rgba(15, 23, 42, 0.06);
}
.hero.hero-empty { min-height: 200px; }
.hero::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  left: var(--mx, 50%); top: var(--my, 50%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--hero-spotlight), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-med);
}
.hero:hover::before { opacity: 1; }
.hero > * { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-block; margin-bottom: var(--s-3); }
.hero .eyebrow:not(.accent) { color: var(--hero-text); }
.hero-title { margin-bottom: var(--s-4); color: var(--hero-text-strong); }
.hero-lede { margin-bottom: var(--s-5); color: var(--hero-lede); }
.hero-meta { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }

/* ============== 12. CARDS WORKSPACE ============== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: all var(--t-med);
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: var(--card-hover-glow);
}
[data-theme="dark"] .card:hover { border-color: rgba(192, 132, 252, 0.35); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.card-foot {
  margin-top: var(--s-4); padding-top: var(--s-3);
  border-top: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
}

/* ============== 13. KPI ============== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); margin-bottom: var(--s-8); }
.kpi {
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: all var(--t-med);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: var(--card-hover-glow);
}
[data-theme="dark"] .kpi:hover { border-color: rgba(192, 132, 252, 0.35); }
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-accent);
  opacity: 0; transition: opacity var(--t-fast);
}
.kpi:hover::before { opacity: 1; }
.kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--violet-soft);
  color: var(--violet);
  margin-bottom: var(--s-3);
}
[data-theme="dark"] .kpi-icon { background: rgba(192, 132, 252, 0.15); color: var(--violet-light); }
.kpi-icon.magenta { background: var(--magenta-soft); color: var(--magenta); }
[data-theme="dark"] .kpi-icon.magenta { background: rgba(244, 114, 182, 0.15); color: var(--magenta-light); }
.kpi-icon.success { background: var(--success-soft); color: var(--success); }
.kpi-icon.warning { background: var(--warning-soft); color: var(--warning); }
.kpi-value {
  font-family: var(--serif); font-weight: 400;
  font-size: 36px; line-height: 1;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  margin-bottom: var(--s-2);
  font-variant-numeric: tabular-nums;
}
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); letter-spacing: -0.005em; }
.kpi-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}
.kpi-trend {
  display: inline-flex; align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  margin-top: var(--s-2);
  padding: 2px 6px;
  border-radius: 4px;
}
.kpi-trend.up    { color: var(--success); background: var(--success-soft); }
.kpi-trend.down  { color: var(--danger);  background: var(--danger-soft); }
.kpi-trend.flat  { color: var(--text-muted); background: var(--bg-pill); }

/* ============== 14. SECTIONS / GRIDS ============== */
.section { margin-bottom: var(--s-10); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); }
.section-head-l { display: flex; flex-direction: column; gap: 4px; }
.section-link {
  font-size: 13px;
  color: var(--violet);
  display: inline-flex; align-items: center;
  gap: 4px; font-weight: 500;
}
[data-theme="dark"] .section-link { color: var(--violet-light); }
.section-link:hover { color: var(--magenta); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .section-link:hover { color: var(--magenta-light); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.grid-asym { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s-6); align-items: start; }

/* ============== 15. TIMELINE ============== */
.timeline { position: relative; padding-left: var(--s-5); }
.timeline::before { content: ''; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 1px; background: var(--border); }
.timeline-item {
  position: relative;
  padding: var(--s-3) 0 var(--s-3) var(--s-4);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-3);
  align-items: baseline;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2px; top: 20px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--text-muted);
}
[data-theme="dark"] .timeline-item::before { background: rgba(15, 7, 33, 0.8); border-color: rgba(255,255,255,0.40); }
.timeline-item.accent::before {
  background: var(--magenta);
  border-color: var(--magenta);
  box-shadow: 0 0 10px rgba(219, 39, 119, 0.50);
}
.timeline-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.timeline-text strong { font-weight: 600; color: var(--text-strong); }
.timeline-time {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-whisper);
  white-space: nowrap;
}

/* ============== 16. BOUTONS ============== */
.btn {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: all var(--t-fast);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.30);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(124, 58, 237, 0.40); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-strong);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.btn-ghost { color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { color: var(--text-strong); background: var(--bg-card-hover); }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-lg { padding: 11px 18px; font-size: 14.5px; }
.btn .icon { width: 14px; height: 14px; }

.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-strong); }

/* ============== 17. BADGES / CHIPS ============== */
.badge {
  display: inline-flex; align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 4px;
  background: var(--bg-pill);
  color: var(--text-secondary);
}
.badge-accent  { background: var(--violet-soft);  color: var(--violet); }
[data-theme="dark"] .badge-accent { background: rgba(192, 132, 252, 0.15); color: var(--violet-light); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-dot     { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-flex; align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: var(--bg-pill);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
}

/* ============== 18. TABLES ============== */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  padding: 10px var(--s-4) 12px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-app-alt);
  white-space: nowrap;
}
[data-theme="dark"] .tbl thead th { background: rgba(255, 255, 255, 0.03); }
.tbl tbody td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--t-fast); cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-card-hover); }
.tbl-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--t-fast); }
.tbl tbody tr:hover .tbl-actions { opacity: 1; }

.dot-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.dot-avatar.lg { width: 40px; height: 40px; font-size: 13px; }
.dot-avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.person-cell { display: flex; align-items: center; gap: var(--s-3); }
.person-name { font-weight: 500; color: var(--text-strong); }
.person-sub  { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ============== 19. FORMS ============== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-4); }
.field-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 500;
}
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-strong);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  letter-spacing: -0.005em;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
[data-theme="dark"] .input:focus, [data-theme="dark"] .select:focus, [data-theme="dark"] .textarea:focus {
  border-color: var(--violet-light);
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.15);
}
.input::placeholder, .textarea::placeholder { color: var(--text-whisper); }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 16px, calc(100% - 9px) 16px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
/* Les <option> du dropdown natif sont dessinées en overlay OS — elles
   n'héritent pas vraiment du parent et ignorent les fonds transparents.
   Il faut donc une couleur OPAQUE par thème. */
.input option, .select option, .textarea option {
  background-color: #FFFFFF;
  color: #1A0B2E;
}
[data-theme="dark"] .input option,
[data-theme="dark"] .select option,
[data-theme="dark"] .textarea option {
  background-color: #1E1340;
  color: #FFFFFF;
}
.textarea { resize: vertical; min-height: 72px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }

/* ============== 20. ONGLETS ============== */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: var(--s-6); flex-wrap: wrap; }
.tab {
  padding: 10px 2px;
  margin-right: var(--s-6);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--t-fast);
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex; align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text-strong); }
.tab.is-active { color: var(--text-strong); border-bottom-color: var(--magenta); }
[data-theme="dark"] .tab.is-active { border-bottom-color: var(--magenta-light); }
.tab-count { font-family: var(--mono); font-size: 10.5px; color: var(--text-whisper); }
.tab.is-active .tab-count { color: var(--magenta); }
[data-theme="dark"] .tab.is-active .tab-count { color: var(--magenta-light); }

/* ============== 21. TOOLBAR ============== */
.toolbar { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-5); flex-wrap: wrap; }
.toolbar-search {
  flex: 1; max-width: 320px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  transition: border-color var(--t-fast);
}
.toolbar-search:focus-within { border-color: var(--violet); }
.toolbar-search input { flex: 1; background: none; border: 0; outline: none; font-size: 13.5px; color: var(--text-primary); }
.toolbar-search input::placeholder { color: var(--text-whisper); }
.toolbar-search .icon { color: var(--text-muted); flex-shrink: 0; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

.toolbar-filter {
  display: inline-flex; align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.toolbar-filter:focus-within { border-color: var(--violet); }
.toolbar-filter-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.toolbar-filter select { background: transparent; border: 0; outline: 0; font-size: 13px; color: var(--text-strong); cursor: pointer; padding-right: 4px; }

/* ============== 22. EMPTY STATE ============== */
.empty { padding: var(--s-16) var(--s-6); text-align: center; color: var(--text-muted); }
.empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--s-4);
  border-radius: var(--r-lg);
  background: var(--bg-pill);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.empty-title {
  font-family: var(--serif); font-style: italic;
  font-size: 22px;
  color: var(--text-strong);
  margin-bottom: var(--s-2);
  letter-spacing: -0.015em;
}
.empty-text { font-size: 14px; max-width: 36ch; margin: 0 auto var(--s-5); line-height: 1.55; }

/* ============== 23. MODAL ============== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 7, 33, 0.45);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-6);
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-8);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  animation: modalIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="dark"] .modal {
  background: rgba(30, 19, 64, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--s-5); padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-soft);
}
.modal-title { font-size: 20px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.015em; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--s-3);
  margin-top: var(--s-6); padding-top: var(--s-5);
  border-top: 1px solid var(--border-soft);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Confirm modal variant */
.confirm-modal { max-width: 460px; }
.confirm-msg {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--s-6);
  margin-top: var(--s-2);
}
[data-theme="dark"] .confirm-msg { color: rgba(255, 255, 255, 0.78); }
.confirm-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--violet-soft);
  color: var(--violet);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--s-4);
}
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
[data-theme="dark"] .confirm-icon { background: rgba(192,132,252,0.15); color: var(--violet-light); }
[data-theme="dark"] .confirm-icon.danger { background: rgba(248,113,113,0.15); color: var(--danger); }

/* ============== 24. TOAST ============== */
.toast-zone { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px;
  background: var(--chrome-bg);
  color: white;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 360px;
  border: 1px solid var(--chrome-border);
}
.toast.is-error   { background: var(--danger); border-color: var(--danger); }
.toast.is-success { background: var(--success); border-color: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============== 25. SPINNER ============== */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner.lg { width: 36px; height: 36px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== 26. AUTH (premium glass) ============== */
.auth-screen {
  position: fixed; inset: 0;
  z-index: 1000;
  background:
    radial-gradient(ellipse 1000px 800px at 80% 10%, rgba(192, 132, 252, 0.5), transparent 55%),
    radial-gradient(ellipse 900px 700px at 15% 110%, rgba(236, 72, 153, 0.45), transparent 55%),
    linear-gradient(135deg, #0B0721 0%, #1E1340 25%, #4C1D6E 55%, #781340 95%);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-6);
  overflow: hidden;
}
.auth-bg-orb {
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  pointer-events: none;
}
.auth-bg-orb.o1 { background: #A78BFA; top: -100px; right: 8%; }
.auth-bg-orb.o2 { background: #F472B6; bottom: -120px; left: 10%; }
.auth-spotlight {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 400px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.06), transparent 70%);
}
.auth-card {
  position: relative; z-index: 2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: var(--s-12) var(--s-10);
  width: 100%; max-width: 440px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.50);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
}
.auth-mark { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s-8); }
.auth-mark .brand-mark { width: 38px; height: 38px; font-size: 20px; box-shadow: 0 8px 20px rgba(124, 58, 237, 0.45); }
.auth-mark-text {
  font-family: var(--serif); font-style: italic;
  font-size: 24px; color: white; letter-spacing: -0.01em;
}
.auth-card h2 {
  font-family: var(--serif); font-style: italic;
  font-size: 38px; color: white; letter-spacing: -0.02em;
  margin-bottom: 10px; line-height: 1.1;
}
.auth-card .lede-light { font-size: 14.5px; color: rgba(255, 255, 255, 0.75); margin-bottom: var(--s-8); line-height: 1.55; }
.auth-card .input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: white; padding: 11px 14px;
}
.auth-card .input::placeholder { color: rgba(255, 255, 255, 0.40); }
.auth-card .input:focus {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(244, 114, 182, 0.60);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.20);
}
.auth-card .field-label { color: rgba(255, 255, 255, 0.65); }
.auth-error {
  padding: 10px 14px;
  background: rgba(248, 113, 113, 0.15);
  color: #FCA5A5;
  border-left: 2px solid #F87171;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: var(--s-4);
}
.auth-foot {
  margin-top: var(--s-6);
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.40);
}

/* ============== 27. PLACEHOLDER MODULES ============== */
.placeholder-hero {
  padding: var(--s-12) var(--s-8);
  border-radius: var(--r-xl);
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px -12px rgba(76, 29, 149, 0.30), 0 4px 12px rgba(15, 23, 42, 0.06);
}
.placeholder-icon-wrap {
  width: 64px; height: 64px;
  margin: 0 auto var(--s-5);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.placeholder-title { font-size: 28px; font-weight: 600; color: var(--hero-text-strong); letter-spacing: -0.02em; margin-bottom: var(--s-3); }
.placeholder-text { max-width: 52ch; margin: 0 auto var(--s-5); color: var(--hero-lede); font-size: 14.5px; line-height: 1.55; }
.placeholder-meta { display: flex; justify-content: center; gap: var(--s-5); flex-wrap: wrap; margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid rgba(255, 255, 255, 0.10); }
.placeholder-meta-item { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.placeholder-meta-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.55); }
.placeholder-meta-value { font-size: 13px; color: var(--hero-text-strong); font-weight: 500; }
.placeholder-features { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: var(--s-5); }
.placeholder-feature {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.005em;
}

/* ============== 28. A11Y — Focus visible ring violet ============== */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: 3px;
}
.nav-item:focus-visible, .theme-btn:focus-visible, .icon-btn-chrome:focus-visible {
  outline-color: var(--violet-light);
  outline-offset: 1px;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.topbar-search:focus-within, .toolbar-search:focus-within {
  outline: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--violet-soft), 0 0 0 1px var(--violet);
}
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.30), 0 4px 12px rgba(124, 58, 237, 0.30); }
.card:focus-visible, .kpi:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

/* ============== 29. BREADCRUMB ============== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--chrome-text-muted);
}
.breadcrumb:empty { display: none; }
.breadcrumb-link { color: var(--chrome-text-muted); transition: color var(--t-fast); }
.breadcrumb-link:hover { color: var(--chrome-text-strong); text-decoration: none; }
.breadcrumb-sep { opacity: 0.4; color: var(--chrome-text-whisper); }
.breadcrumb-current { color: var(--chrome-text-strong); }

/* ============== 30. SAVE BAR ============== */
.save-bar {
  position: fixed;
  bottom: 20px;
  left: calc(var(--sidebar-w) + 32px);
  right: 32px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 12px 20px;
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border-strong);
  border-radius: var(--r-lg);
  display: flex; align-items: center;
  gap: var(--s-4);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(192, 132, 252, 0.12);
  z-index: 50;
  animation: saveBarIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.save-bar::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--magenta-light);
  box-shadow: 0 0 8px rgba(244, 114, 182, 0.50);
  flex-shrink: 0;
}
.save-bar-status { flex: 1; font-size: 13.5px; color: var(--chrome-text); letter-spacing: -0.005em; }
.save-bar-status strong { color: var(--chrome-text-strong); font-weight: 600; }
.save-bar .btn-ghost { color: var(--chrome-text-muted); }
.save-bar .btn-ghost:hover { color: var(--chrome-text-strong); background: var(--chrome-bg-hover); }
@keyframes saveBarIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============== 31. SKELETON ============== */
.skel {
  background: linear-gradient(90deg, var(--bg-pill) 0%, var(--bg-card-hover) 50%, var(--bg-pill) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
[data-theme="dark"] .skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
}
.skel-bar  { height: 12px; }
.skel-card { height: 180px; border-radius: var(--r-lg); border: 1px solid var(--border); }
.skel-row  { height: 56px; border-bottom: 1px solid var(--border-soft); border-radius: 0; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============== 32. COMMAND PALETTE (⌘K) ============== */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 7, 33, 0.55);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh var(--s-6) var(--s-6);
  animation: fadeIn 0.18s ease;
}
.cmdk {
  width: 100%;
  max-width: 580px;
  background: rgba(24, 20, 56, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 40px 80px -16px rgba(0,0,0,0.55), 0 0 0 1px rgba(192,132,252,0.12);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  overflow: hidden;
  animation: cmdkIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: var(--chrome-text);
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.cmdk-input-wrap { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.cmdk-input-wrap .icon { color: rgba(255, 255, 255, 0.55); flex-shrink: 0; }
.cmdk-input { flex: 1; background: transparent; border: 0; outline: 0; font-size: 16px; color: #FFFFFF; letter-spacing: -0.01em; }
.cmdk-input::placeholder { color: rgba(255, 255, 255, 0.40); }
.cmdk-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.cmdk-group-label {
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.40);
  padding: 10px 12px 6px;
}
.cmdk-item {
  display: flex; align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: background var(--t-fast);
}
.cmdk-item.is-active { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.cmdk-item-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.70);
  flex-shrink: 0;
}
.cmdk-item.is-active .cmdk-item-icon { background: var(--gradient-accent); color: white; }
.cmdk-item-text { flex: 1; min-width: 0; }
.cmdk-item-label { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.45); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-kbd { font-family: var(--mono); font-size: 10px; padding: 2px 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 4px; color: rgba(255, 255, 255, 0.55); flex-shrink: 0; }
.cmdk-close { font-family: var(--mono); font-size: 10px; padding: 3px 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 4px; color: rgba(255, 255, 255, 0.65); flex-shrink: 0; cursor: pointer; transition: all var(--t-fast); }
.cmdk-close:hover { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; border-color: rgba(255, 255, 255, 0.20); }
.cmdk-empty { padding: 32px 16px; text-align: center; color: rgba(255, 255, 255, 0.45); font-size: 13.5px; }
.cmdk-foot {
  display: flex; align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.cmdk-foot-item { display: inline-flex; align-items: center; gap: 6px; }
.cmdk-foot-key { padding: 1px 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.10); }

/* ============== 33. NOTIFICATIONS DRAWER ============== */
.notif-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 7, 33, 0.40);
  backdrop-filter: blur(4px);
  z-index: 150;
  animation: fadeIn 0.2s ease;
}
.notif-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 400px;
  z-index: 160;
  background: rgba(24, 20, 56, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: -24px 0 48px -16px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  display: flex; flex-direction: column;
  animation: notifIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: var(--chrome-text);
}
@keyframes notifIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.notif-head { padding: 20px 24px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; justify-content: space-between; }
.notif-title { font-family: var(--serif); font-style: italic; font-size: 22px; color: #FFFFFF; letter-spacing: -0.015em; }
.notif-close { width: 32px; height: 32px; border-radius: 6px; color: rgba(255, 255, 255, 0.55); display: inline-flex; align-items: center; justify-content: center; transition: all var(--t-fast); }
.notif-close:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.notif-body { flex: 1; overflow-y: auto; padding: 8px; }
.notif-group { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.40); padding: 14px 14px 8px; }
.notif-item {
  display: flex; align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--t-fast);
  color: rgba(255, 255, 255, 0.88);
}
.notif-item:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
.notif-item.is-priority { background: rgba(244, 114, 182, 0.08); }
.notif-item-icon { width: 34px; height: 34px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); display: inline-flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.80); flex-shrink: 0; }
.notif-item.is-priority .notif-item-icon { background: var(--gradient-accent); color: white; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.30); }
.notif-item-text { flex: 1; min-width: 0; }
.notif-item-title { font-size: 14px; font-weight: 500; color: #FFFFFF; letter-spacing: -0.005em; line-height: 1.35; }
.notif-item-sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.60); margin-top: 3px; line-height: 1.4; }
.notif-item-time { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.40); margin-top: 6px; }

/* ============== 34. THEME TRANSITION (animé au switch) ============== */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    fill 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1)
    !important;
}

/* ============== 35. SPARKLINE ============== */
.sparkline { display: block; margin-top: 10px; width: 100%; max-width: 130px; height: 28px; opacity: 0.92; }

/* ============== 36. FLIP BRAND-MARK ============== */
.brand-mark-flip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform-origin: top left;
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1), box-shadow 0.7s cubic-bezier(0.65, 0, 0.35, 1);
  background: var(--gradient-accent);
  color: white;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic; font-weight: 500;
}

/* ============== 37. UTILS ============== */
.icon { width: 16px; height: 16px; display: inline-block; flex-shrink: 0; }
.row-2 { display: flex; align-items: center; gap: var(--s-2); }
.row-3 { display: flex; align-items: center; gap: var(--s-3); }
.stack-2 { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--s-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--s-4); }

/* ============== 38. VIEW SWITCHER (carte / liste) ============== */
.view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  border-radius: var(--r-md);
}
.view-switcher-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--chrome-text);
  cursor: pointer;
  transition: all var(--t-fast);
}
.view-switcher-btn:hover { color: var(--chrome-text-strong); background: var(--chrome-bg-hover); }
.view-switcher-btn.is-active {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 2px 6px -1px rgba(124, 58, 237, 0.40);
}
.view-switcher-btn.is-active:hover { color: white; }

/* ============== 39. RESPONSIVE ============== */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-asym { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  :root { --sidebar-w: 64px; }
  .sidebar { overflow: hidden; }
  .brand-text, .nav-cat, .nav-item-name, .nav-status-dot { display: none; }
  .topbar-brand { padding: 0; justify-content: center; }
  .nav-item { justify-content: center; padding: 10px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main { padding: var(--s-5) var(--s-5); }
  .field-row { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .breadcrumb { display: none; }
  .topbar-content { padding: 0 var(--s-4); justify-content: flex-end; }
}
