@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ================================================================
   ADRIAL CONSEILS — DESIGN SYSTEM PREMIUM v9.0
   Aptos > Plus Jakarta Sans > DM Sans (fallback)
   Palette: #2D5A1B · #498831 · #8AB833 · #E2F0D9
   Ref: Anthropic.com — épuré, aéré, intelligent, sobre, haut de gamme
   ================================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- CSS Variables --- */
:root {
  /* IDENTITÉ — changer ces 4 lignes suffit pour un nouveau projet */
  --cabinet-name: "ADRIAL CONSEILS";
  --agent-name: "Antoine";
  --cabinet-tagline: "Cabinet AMO";
  --logo-initiales: "AC";

  /* COULEURS PRINCIPALES */
  --color-bg: #E2F0D9;
  --color-surface: #FFFFFF;
  --color-primary: #2D5A1B;
  --color-secondary: #498831;
  --color-accent: #8AB833;
  --color-text: #2D5A1B;
  --color-text-light: #4A6741;
  --color-border: rgba(45,90,27,0.1);

  /* COULEURS ÉTAT */
  --color-success: #5A9E2F;
  --color-error: #C0392B;
  --color-warning: #E67E22;

  /* TYPOGRAPHIE */
  --font-main: 'Aptos', 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-md: 15px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* ESPACEMENTS */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* BORDURES */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* OMBRES */
  --shadow-sm: 0 2px 8px rgba(45,90,27,0.06);
  --shadow-md: 0 4px 24px rgba(45,90,27,0.08);
  --shadow-lg: 0 8px 40px rgba(45,90,27,0.12);
  --shadow-hover: 0 12px 48px rgba(45,90,27,0.16);

  /* ANIMATIONS */
  --transition: 200ms ease-in-out;
  --transition-slow: 400ms ease-in-out;

  /* LAYOUT */
  --sidebar-width: 220px;
  --panel-right-width: 300px;
  --header-height: 60px;

  /* Z-INDEX */
  --z-sidebar: 50;
  --z-header: 100;
  --z-dropdown: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* ANCIENS ALIAS — compatibilité avec le code existant */
  --green-dark: var(--color-primary);
  --green-mid: var(--color-secondary);
  --green-accent: var(--color-accent);
  --green-light: var(--color-bg);
  --white: var(--color-surface);
  --text-dark: var(--color-text);
  --text-muted: var(--color-text-light);
  --radius: var(--radius-md);
  --header-h: var(--header-height);
  --sidebar-w: var(--sidebar-width);
  --sidebar-collapsed-w: 64px;
  --doc-panel-w: var(--panel-right-width);
  --font: var(--font-main);
  --font-display: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  --font-size: var(--font-size-md);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Mode Sombre --- */
body.dark, [data-theme="dark"] {
  --color-bg: #0F1A0B;
  --color-surface: #1A2E14;
  --color-primary: #E2F0D9;
  --color-secondary: #8AB833;
  --color-accent: #A8D44F;
  --color-text: #E2F0D9;
  --color-text-light: #8AB833;
  --color-border: rgba(226,240,217,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-hover: 0 12px 48px rgba(0,0,0,0.6);
  /* Alias compat */
  --green-dark: var(--color-primary);
  --green-mid: var(--color-secondary);
  --green-accent: var(--color-accent);
  --green-light: var(--color-bg);
  --white: var(--color-surface);
  --text-dark: var(--color-text);
  --text-muted: var(--color-text-light);
}

/* --- Base Typography --- */
html {
  font-size: var(--font-size-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-main);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  line-height: 1.6;
  letter-spacing: -0.011em;
}

/* CLASSES UTILITAIRES RÉUTILISABLES */
.surface { background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.text-primary { color: var(--color-primary); }
.text-light { color: var(--color-text-light); }
.font-bold { font-weight: var(--font-weight-bold); }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { opacity: 0.85; }
button {
  cursor: pointer; border: none; background: none;
  font-family: inherit; font-size: inherit; color: inherit;
  transition: all var(--transition);
}
input, textarea, select {
  font-family: inherit; font-size: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
p { line-height: 1.65; }

/* --- Selection --- */
::selection { background: rgba(138,184,51,0.25); color: var(--text-dark); }
[data-theme="dark"] ::selection { background: rgba(138,184,51,0.35); }

/* --- Scrollbars Premium --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: var(--color-accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-secondary); }
* { scrollbar-width: thin; scrollbar-color: var(--color-accent) var(--color-bg); }

/* --- Animations (JS-referenced keyframe names) --- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes letterAppear { to { opacity: 1; } }
@keyframes starPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(138,184,51,0.6)); }
}
@keyframes starBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes typingPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes widgetFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Focus Rings (accessibility) --- */
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* États désactivés — accessibilité */
button:disabled, input:disabled, textarea:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Taille minimale zones cliquables — accessibilité mobile */
button, .command-chip, .sidebar-item, .profile-card {
  min-height: 44px;
  min-width: 44px;
}

/* ========== PIN LOGIN ========== */
.pin-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center;
}
.pin-overlay.active { display: flex; }
.pin-card {
  background: var(--white);
  border-radius: 24px;
  padding: 40px 36px;
  width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(138,184,51,0.08);
  animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.pin-card h3 { color: #2D5A1B; margin-bottom: 6px; font-size: 1.15rem; }
.pin-card p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 24px; }
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(45,90,27,0.3);
  transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
  background: transparent;
}
.pin-dot.filled {
  background: linear-gradient(135deg, #498831, #2D5A1B);
  border-color: #498831;
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(73,136,49,0.3);
}
.pin-dot.error { background: #DC2626; border-color: #DC2626; animation: shake 0.3s; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 230px; margin: 0 auto; }
.pin-key {
  width: 58px; height: 58px; border-radius: 50%;
  font-size: 1.3rem; font-weight: 600; color: #2D5A1B;
  background: rgba(73,136,49,0.05);
  display: flex; align-items: center; justify-content: center;
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
  margin: 0 auto;
  border: 1px solid rgba(73,136,49,0.08);
}
.pin-key:hover {
  background: linear-gradient(135deg, #498831, #2D5A1B);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(45,90,27,0.25);
}
.pin-key:active { transform: scale(0.95); }
.pin-key.wide { width: auto; border-radius: var(--radius-sm); padding: 0 18px; font-size: 0.85rem; }
.pin-attempts { font-size: 0.8rem; color: #DC2626; margin-top: 12px; display: none; }
.pin-attempts.visible { display: block; }
.pin-blocked { font-size: 0.9rem; color: #DC2626; font-weight: 600; }

/* ========== ONLINE STATUS ========== */
.status-toggle {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 4px 12px;
  border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.8); transition: all 200ms;
}
.status-toggle:hover { background: rgba(255,255,255,0.12); color: #fff; }
.status-toggle .st-dot {
  width: 8px; height: 8px; border-radius: 50%;
  transition: all 200ms;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}
.status-toggle .st-dot.online { background: #22C55E; box-shadow: 0 0 0 2px rgba(34,197,94,0.2), 0 0 8px rgba(34,197,94,0.4); }
.status-toggle .st-dot.offline { background: #6b7280; }

/* ========== SPLASH SCREEN ========== */
#splash {
  position: fixed; inset: 0; z-index: 10000;
  background: radial-gradient(ellipse at 30% 20%, #3a7023 0%, #2D5A1B 40%, #1a3d10 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
#splash::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 60% 80%, rgba(138,184,51,0.08) 0%, transparent 50%);
  pointer-events: none;
}
#splash.hidden { opacity: 0; transform: scale(1.03); pointer-events: none; }
#splash .logo-text {
  color: #fff; font-family: var(--font-display);
  font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 4px; opacity: 0;
  animation: fadeSlideUp 0.7s 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
#splash .logo-sub {
  color: rgba(255,255,255,0.55); font-size: 0.9rem; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 48px; opacity: 0;
  animation: fadeSlideUp 0.7s 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#splash .progress-track {
  width: 200px; height: 2px; background: rgba(255,255,255,0.1);
  border-radius: 2px; overflow: hidden; opacity: 0;
  animation: fadeSlideUp 0.5s 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#splash .progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #8AB833, #a8d44a);
  border-radius: 2px; transition: width 0.3s ease;
}
#splash .loading-text {
  color: rgba(255,255,255,0.4); font-size: 0.8rem; margin-top: 20px;
  font-weight: 400; letter-spacing: 0.04em; opacity: 0;
  animation: fadeSlideUp 0.5s 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ========== LOGIN PAGE ========== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
#loginPage {
  position: fixed; inset: 0; z-index: 9000;
  background: linear-gradient(135deg, #1A3A0F 0%, var(--color-primary) 40%, var(--color-secondary) 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  display: none; flex-direction: column; align-items: center; justify-content: center;
}
#loginPage::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(138,184,51,0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
#loginPage::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(138,184,51,0.06) 0%, transparent 60%);
  pointer-events: none;
}
#loginPage.active { display: flex; }
.login-card-container {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 48px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
  text-align: center;
  max-width: 480px;
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 90%;
  position: relative;
  margin: auto;
}
[data-theme="dark"] .login-card-container {
  background: rgba(31,61,31,0.95);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(138,184,51,0.1);
}
.login-card-container .login-logo {
  font-family: var(--font-main); font-size: 28px; font-weight: 800;
  color: var(--color-primary); margin-bottom: 4px; letter-spacing: -0.5px;
}
.login-card-container .login-title {
  font-family: var(--font-main); font-size: 15px; font-weight: 400;
  color: var(--color-text-light); margin-bottom: 32px; letter-spacing: -0.01em;
}
.profiles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-card {
  background: var(--color-surface);
  border: 1.5px solid rgba(45,90,27,0.12);
  border-radius: 20px;
  padding: 24px 16px;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: translateY(20px);
  text-align: center;
  box-shadow: 0 4px 16px rgba(45,90,27,0.08);
}
.profile-card.visible { opacity: 1; transform: translateY(0); }
.profile-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 48px rgba(45,90,27,0.20);
  border-color: var(--color-accent);
}
.profile-card:active { transform: translateY(-2px) scale(0.99); }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-weight: 800; font-size: 20px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
  border: none;
  box-shadow: 0 4px 16px rgba(45,90,27,0.3);
  transition: all var(--transition);
}
.profile-card:hover .profile-avatar {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(73,136,49,0.25);
}
.profile-card .profile-name { font-weight: 700; font-size: 15px; color: var(--color-primary); margin-bottom: 4px; }
.profile-card .profile-role { font-size: 12px; color: var(--color-text-light); font-style: italic; }
.admin-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  color: #FFFFFF; font-size: 10px; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; margin-top: 6px; letter-spacing: 0.5px;
}

/* ========== WELCOME ANIMATION ========== */
#welcomeOverlay {
  position: fixed; inset: 0; z-index: 8500;
  background: linear-gradient(135deg, #2D5A1B, #1a3d10);
  display: none; align-items: center; justify-content: center;
  color: #fff; font-size: 2rem; font-weight: 600;
}
#welcomeOverlay.active { display: flex; }
#welcomeOverlay .welcome-text span {
  opacity: 0; display: inline-block;
  animation: letterAppear 0.05s forwards;
}

/* ========== ONBOARDING ========== */
#onboardingOverlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
#onboardingOverlay.active { display: flex; }
.onboarding-card {
  background: var(--white); border-radius: 24px;
  padding: 48px 40px; max-width: 500px; width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(138,184,51,0.06);
  animation: scaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.onboarding-card .ob-icon { font-size: 3rem; margin-bottom: 16px; }
.onboarding-card .ob-title {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  color: #2D5A1B; margin-bottom: 12px; letter-spacing: -0.02em;
}
.onboarding-card .ob-desc { color: var(--text-muted); line-height: 1.65; margin-bottom: 24px; }
.onboarding-card .ob-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.onboarding-card .ob-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ddd;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.onboarding-card .ob-dot.active { background: #8AB833; transform: scale(1.2); }
.onboarding-card .ob-btn {
  background: linear-gradient(135deg, #2D5A1B, #498831); color: #fff;
  padding: 12px 32px; border-radius: var(--radius-sm); font-weight: 600;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 12px rgba(45,90,27,0.2);
}
.onboarding-card .ob-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45,90,27,0.3);
}
.onboarding-card .ob-skip { color: var(--text-muted); font-size: 0.85rem; margin-top: 12px; cursor: pointer; transition: color 0.2s; }
.onboarding-card .ob-skip:hover { color: var(--text-dark); text-decoration: underline; }

/* ========== MAIN APP LAYOUT ========== */
#app { display: none; height: 100vh; width: 100vw; }
#app.active { display: flex; flex-direction: column; }

/* ========== HEADER ========== */
#header {
  height: var(--header-h);
  background: linear-gradient(90deg, #2D5A1B, #3a6e22);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; padding: 0 20px; gap: 14px;
  color: #fff; z-index: 100; flex-shrink: 0;
  border-bottom: 1px solid rgba(138,184,51,0.12);
  box-shadow: 0 2px 20px rgba(45,90,27,0.35);
}
#header .header-logo {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.15rem; white-space: nowrap; letter-spacing: -0.02em;
}
#header .header-separator { width: 1px; height: 28px; background: rgba(255,255,255,0.18); }
.header-mission-select {
  background: rgba(255,255,255,0.06); color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.85rem;
  max-width: 200px; cursor: pointer; transition: all var(--transition);
}
.header-mission-select:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.1); }
.header-mission-select option { background: #2D5A1B; color: #fff; }
#agentIndicator { font-style: italic; font-size: 0.85rem; opacity: 0.8; white-space: nowrap; display: none; }
#agentIndicator.active { display: inline; }
.header-spacer { flex: 1; }
.header-btn {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  font-size: 1.1rem; position: relative;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
}
.header-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 0 20px rgba(138,184,51,0.1);
}
.header-btn:active { transform: translateY(0) scale(0.96); }
.header-btn .badge {
  position: absolute; top: 0px; right: 0px; width: 16px; height: 16px;
  background: #EF4444; border-radius: 50%; font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
}
#themeToggle { font-size: 1.1rem; }
#statusDot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #22C55E; border: 2px solid rgba(255,255,255,0.3);
  cursor: help; box-shadow: 0 0 8px rgba(34,197,94,0.4);
}
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; color: #fff;
  border: 2px solid rgba(255,255,255,0.35);
  transition: all var(--transition);
}
.header-avatar:hover { border-color: rgba(255,255,255,0.6); }
.header-user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; color: #FFFFFF; }
.header-admin-badge {
  background: linear-gradient(135deg, #D4A017, #F0C040);
  font-size: 0.55rem; padding: 1px 6px; border-radius: 8px; font-weight: 700; color: #fff;
  box-shadow: 0 1px 4px rgba(212,160,23,0.3);
}
#settingsBtn { font-size: 1.2rem; }

/* ========== SIDEBAR ========== */
#sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--color-primary) 0%, #1a3a12 100%);
  color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden; z-index: var(--z-sidebar);
  border-right: 1px solid rgba(138,184,51,0.08);
}
#sidebar.collapsed { width: 72px; }
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  height: 40px; cursor: pointer; color: rgba(255,255,255,0.6);
  transition: all 0.2s; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.04); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; margin: 1px 8px; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
  border-left: 3px solid transparent; font-size: 0.88rem;
  border-radius: 8px; font-weight: 450;
}
.sidebar-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-item.active {
  background: linear-gradient(135deg, #498831, #2D5A1B);
  color: white; font-weight: 600;
  border-left-color: transparent;
  box-shadow: 0 4px 16px rgba(45,90,27,0.3);
}
.sidebar-item .sidebar-icon { font-size: 1.1rem; min-width: 24px; text-align: center; }
.sidebar-label { display: block !important; visibility: visible !important; opacity: 1 !important; transition: opacity 200ms ease; }
#sidebar.collapsed .sidebar-label { display: none !important; opacity: 0 !important; }
/* sidebar-label toujours visible */
#sidebar.collapsed .sidebar-item { justify-content: center; padding: 10px 0; }
#sidebar.collapsed .poles-content { display: none; }
/* poles-header label toujours visible */
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 16px; }
.poles-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer;
  transition: all 0.2s; font-size: 0.9rem; white-space: nowrap;
  border-radius: 6px; margin: 0 4px;
}
.poles-header:hover { background: rgba(255,255,255,0.08); }
.poles-header .arrow { font-size: 0.7rem; margin-left: auto; transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.poles-header.open .arrow { transform: rotate(180deg); }
.poles-content { overflow: hidden; max-height: 0; transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.poles-content.open { max-height: 500px; }
.poles-content .sidebar-item { padding-left: 28px; font-size: 0.85rem; }
.sidebar-badge-count {
  background: #EF4444; color: #fff; font-size: 0.6rem;
  padding: 1px 6px; border-radius: 10px; font-weight: 700; margin-left: auto;
  box-shadow: 0 1px 4px rgba(239,68,68,0.3);
}
.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 16px;
}
.sidebar-new-conv {
  width: 100%; padding: 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08); color: #fff; font-weight: 600;
  font-size: 0.85rem; text-align: center;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.06);
}
.sidebar-new-conv:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
#sidebar.collapsed .sidebar-new-conv span { display: none; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; font-size: 0.85rem;
}
.sidebar-user .online-dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; flex-shrink: 0; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
#sidebar.collapsed .sidebar-user-name { display: none; }

/* ========== MAIN CONTENT ========== */
#mainContent {
  flex: 1; display: flex; overflow: hidden;
  background: #E2F0D9;
}
[data-theme="dark"] #mainContent { background: #0D1F0D; }

/* ========== CHAT VIEW ========== */
#chatView { flex: 1; display: none; flex-direction: column; overflow: hidden; }
#chatView.active { display: flex; }
.chat-main { flex: 1; display: flex; overflow: hidden; }
.chat-content {
  flex: 1; display: flex; flex-direction: column;
  padding: 28px 32px; overflow-y: auto;
}
.chat-greeting { margin-bottom: 28px; }
.chat-greeting h2 {
  font-family: var(--font-display); font-size: 1.7rem;
  color: #2D5A1B; font-weight: 800; letter-spacing: -0.03em;
}
[data-theme="dark"] .chat-greeting h2 { color: #8AB833; }

/* --- Chat Input --- */
.chat-input-top {
  background: var(--white); border: 2px solid #e4ede0; border-radius: 20px;
  display: flex; align-items: center; padding: 10px 16px; gap: 10px;
  box-shadow: var(--shadow-sm); margin-bottom: 20px; flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-input-top:focus-within {
  border-color: #498831;
  box-shadow: 0 0 0 4px rgba(73,136,49,0.12), var(--shadow-md);
  transform: translateY(-2px);
}
.chat-input-top input {
  flex: 1; border: none; outline: none; font-size: 1rem;
  background: transparent; color: var(--text-dark);
}
.chat-input-top input::placeholder { color: var(--text-muted); }
.chat-input-btn {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1); font-size: 1.1rem;
}
.chat-input-btn:hover { transform: scale(1.08); }
.chat-input-btn:active { transform: scale(0.95); }
.chat-input-btn.mic-btn { color: #2D5A1B; }
.chat-input-btn.mic-btn.recording { color: #8AB833; animation: starPulse 1.5s infinite; }
.chat-input-btn.send-btn {
  background: linear-gradient(135deg, #498831, #2D5A1B);
  color: #fff; border-radius: 14px;
  box-shadow: 0 2px 8px rgba(45,90,27,0.2);
}
.chat-input-btn.send-btn:hover {
  box-shadow: 0 4px 16px rgba(45,90,27,0.3);
  transform: scale(1.08);
}
.chat-input-btn.synth-btn { color: #D4A017; }

/* --- Command Chips --- */
.command-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.command-chip {
  background: var(--white); border: 1px solid rgba(45,90,27,0.15);
  padding: 7px 16px; border-radius: 99px; font-size: 0.8rem;
  color: #498831; cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  font-weight: 500;
}
.command-chip:hover {
  background: linear-gradient(135deg, #498831, #2D5A1B); color: #fff;
  border-color: transparent; transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(45,90,27,0.25);
}
.command-chip:active { transform: translateY(0) scale(0.97); }
[data-theme="dark"] .command-chip { background: #1F3D1F; border-color: #2D5A1B; color: #8AB833; }

/* --- Conversation History --- */
.chat-conv-history { margin-bottom: 20px; }
.chat-conv-history h4 {
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.conv-item {
  background: var(--white); padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 6px; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-sm); font-size: 0.9rem;
  border: 1px solid transparent;
}
.conv-item:hover {
  box-shadow: var(--shadow-md); transform: translateY(-1px);
  border-color: rgba(73,136,49,0.12);
}

/* --- Chat Messages --- */
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }
.chat-msg {
  display: flex; gap: 10px; max-width: 80%;
  animation: msgFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 32px; height: 32px; min-width: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: #fff; flex-shrink: 0;
}
.chat-msg-avatar.antoine {
  background: linear-gradient(135deg, #498831, #2D5A1B);
  box-shadow: 0 2px 8px rgba(45,90,27,0.2);
}
.chat-msg-bubble {
  padding: 14px 18px; line-height: 1.65; font-size: 0.92rem;
  position: relative;
}
.chat-msg.user .chat-msg-bubble {
  background: var(--user-accent-color, var(--color-primary));
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
[data-theme="dark"] .chat-msg.user .chat-msg-bubble {
  background: var(--user-accent-color, var(--color-primary));
  color: #FFFFFF;
}
.chat-msg.assistant .chat-msg-bubble {
  background: #FFFFFF;
  border: none;
  border-left: 3px solid var(--color-primary);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 12px rgba(45,90,27,0.08);
  color: var(--text-dark);
}
[data-theme="dark"] .chat-msg.assistant .chat-msg-bubble {
  background: var(--color-surface);
  border-left-color: var(--color-accent);
}
.chat-msg-time {
  font-size: 0.68rem; color: var(--text-muted); margin-top: 6px;
  letter-spacing: 0.02em; opacity: 0.7;
}
.chat-msg.user .chat-msg-time { text-align: right; }

/* --- Message Actions --- */
.chat-msg-actions {
  display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap;
}
.chat-msg-action {
  font-size: 0.7rem; padding: 6px 14px; border-radius: 12px;
  color: #fff; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
  background: var(--text-muted);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.chat-msg-action:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.chat-msg-action:active { transform: translateY(-1px) scale(0.98); }
.chat-msg-action.act-copy { background: linear-gradient(135deg, #498831, #2D5A1B); }
.chat-msg-action.act-word { background: #2B579A; }
.chat-msg-action.act-excel { background: #217346; }
.chat-msg-action.act-ppt { background: #D24726; }
.chat-msg-action.act-pdf { background: #CC0000; }
.chat-msg-action.act-fav { background: #F4B400; }
.chat-msg-action.act-print { background: #666; }
.chat-msg-action.act-error {
  background: transparent; color: var(--text-muted);
  border: 1px solid rgba(0,0,0,0.1); font-weight: 400;
  box-shadow: none;
}

/* --- Typing Indicator --- */
.typing-indicator {
  display: none; align-items: center; gap: 5px;
  font-size: 0.85rem; color: var(--text-muted); font-style: italic;
  padding: 10px 0;
}
.typing-indicator.active { display: flex; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #498831, #8AB833);
  animation: typingPulse 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* --- Context Menu --- */
.context-menu {
  position: fixed; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 6px; z-index: 1000;
  min-width: 200px; display: none;
  animation: scaleIn 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}
.context-menu.visible { display: block; }
.context-menu-item {
  padding: 8px 14px; font-size: 0.85rem; cursor: pointer;
  transition: all 0.15s; border-radius: var(--radius-sm);
}
.context-menu-item:hover { background: rgba(73,136,49,0.08); color: #2D5A1B; }

/* ========== DOCUMENTS PANEL ========== */
.doc-panel {
  width: 280px; background: var(--white);
  border-left: 1px solid rgba(45,90,27,0.1);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: width 300ms ease, opacity 300ms ease;
  overflow: hidden;
}
.doc-panel.hidden {
  width: 0; opacity: 0; padding: 0; border: none; overflow: hidden;
}
.doc-panel-header {
  padding: 16px 20px; font-weight: 700; color: var(--color-primary); font-size: 0.95rem;
  border-bottom: 1px solid rgba(45,90,27,0.08);
  letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: space-between;
}
[data-theme="dark"] .doc-panel-header { color: #8AB833; }
.doc-panel-content { flex: 1; overflow-y: auto; padding: 16px; }
.doc-panel-empty {
  text-align: center; color: var(--text-muted); font-size: 0.85rem;
  padding: 40px 16px; line-height: 1.6;
}
.doc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: var(--radius);
  background: rgba(45,90,27,0.03); margin-bottom: 8px;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid transparent;
}
.doc-item:hover {
  background: rgba(45,90,27,0.06);
  border-color: rgba(73,136,49,0.1);
  transform: translateY(-1px);
}
.doc-item-icon { font-size: 1.5rem; }
.doc-item-info { flex: 1; }
.doc-item-name { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); }
.doc-item-date { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.doc-item-actions { display: flex; gap: 4px; }
.doc-item-btn {
  font-size: 0.7rem; padding: 4px 10px; border-radius: var(--radius-sm);
  background: #E2F0D9; color: #2D5A1B; cursor: pointer;
  transition: all 0.15s; font-weight: 500;
}
.doc-item-btn:hover { background: #c8e6b8; transform: translateY(-1px); }

/* ========== DASHBOARD VIEW ========== */
#dashboardView { flex: 1; display: none; flex-direction: column; overflow-y: auto; padding: 28px 32px; }
#dashboardView.active { display: flex; }
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.dash-greeting h2 {
  font-family: var(--font-display); font-size: 1.7rem;
  color: #2D5A1B; font-weight: 800; letter-spacing: -0.03em;
}
[data-theme="dark"] .dash-greeting h2 { color: #8AB833; }
.dash-greeting p { font-size: 0.88rem; color: var(--text-muted); margin-top: 6px; letter-spacing: 0; }
.dash-customize-btn {
  padding: 8px 20px; border-radius: var(--radius-sm);
  background: var(--white); color: #2D5A1B; font-weight: 600;
  box-shadow: var(--shadow-sm); font-size: 0.85rem;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid rgba(45,90,27,0.1);
}
.dash-customize-btn:hover {
  box-shadow: var(--shadow-md); transform: translateY(-2px);
  border-color: rgba(73,136,49,0.2);
}

/* --- Widgets --- */
.widgets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.widget {
  background: var(--white); border-radius: 16px; padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(138,184,51,0.06);
  opacity: 0; animation: widgetFadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.widget:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: rgba(138,184,51,0.1);
}
.widget.span-2 { grid-column: span 2; }
.widget h3 {
  font-size: 1rem; color: #2D5A1B; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .widget h3 { color: #8AB833; }
.widget .widget-empty {
  color: var(--text-muted); font-size: 0.85rem;
  padding: 20px 0; text-align: center; line-height: 1.6;
}
.widget:nth-child(1)  { animation-delay: 0ms; }
.widget:nth-child(2)  { animation-delay: 80ms; }
.widget:nth-child(3)  { animation-delay: 160ms; }
.widget:nth-child(4)  { animation-delay: 240ms; }
.widget:nth-child(5)  { animation-delay: 320ms; }
.widget:nth-child(6)  { animation-delay: 400ms; }
.widget:nth-child(7)  { animation-delay: 480ms; }
.widget:nth-child(8)  { animation-delay: 560ms; }
.widget:nth-child(9)  { animation-delay: 640ms; }
.widget:nth-child(10) { animation-delay: 720ms; }

/* --- Kanban --- */
.kanban-cols { display: flex; gap: 8px; }
.kanban-col {
  flex: 1; background: rgba(45,90,27,0.03); border-radius: var(--radius);
  padding: 10px; min-height: 60px;
}
.kanban-col-title {
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.04em;
}

/* --- Status --- */
.status-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.85rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.green { background: #22C55E; box-shadow: 0 0 6px rgba(34,197,94,0.3); }
.status-dot.red { background: #EF4444; box-shadow: 0 0 6px rgba(239,68,68,0.3); }
.status-dot.orange { background: #F59E0B; box-shadow: 0 0 6px rgba(245,158,11,0.3); }

/* --- Notes --- */
.notes-textarea {
  width: 100%; min-height: 80px; border: 1px solid rgba(45,90,27,0.15);
  border-radius: var(--radius); padding: 12px; resize: vertical;
  background: transparent; color: var(--text-dark); outline: none;
  font-size: 0.85rem; transition: all var(--transition);
}
.notes-textarea:focus {
  border-color: #498831;
  box-shadow: 0 0 0 3px rgba(73,136,49,0.08);
}

/* --- Favorites --- */
.fav-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fav-chip {
  background: #E2F0D9; color: #2D5A1B; padding: 5px 14px;
  border-radius: 20px; font-size: 0.8rem; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1); font-weight: 500;
}
[data-theme="dark"] .fav-chip { background: #2D5A1B; color: #8AB833; }
.fav-chip:hover { background: #c8e6b8; transform: translateY(-1px); }

/* --- Adrial Score --- */
.adrial-score {
  grid-column: span 2; text-align: center; padding: 16px 20px;
  font-size: 0.9rem; color: #2D5A1B; font-weight: 600;
  background: linear-gradient(135deg, #E2F0D9, #f0f7eb);
  border: 1px solid rgba(138,184,51,0.2); border-radius: var(--radius);
}

/* ========== MISSIONS / VIEWS ========== */
#missionsView, #annuaireView, #calendarView, #livrablesView, #veilleView, #favorisView {
  flex: 1; display: none; flex-direction: column; overflow-y: auto; padding: 28px 32px;
}
#missionsView.active, #annuaireView.active, #calendarView.active,
#livrablesView.active, #veilleView.active, #favorisView.active { display: flex; }
.view-title {
  font-family: var(--font-display); font-size: 1.4rem;
  color: #2D5A1B; font-weight: 800; margin-bottom: 20px;
  letter-spacing: -0.025em;
}
[data-theme="dark"] .view-title { color: #8AB833; }
.view-empty {
  background: var(--white); border-radius: var(--radius-lg); padding: 48px;
  text-align: center; color: var(--text-muted); box-shadow: var(--shadow-sm);
  border: 1px solid rgba(138,184,51,0.06);
}

/* --- Search & Filters --- */
.search-bar {
  display: flex; align-items: center; gap: 8px; background: var(--white);
  border: 1px solid rgba(45,90,27,0.15); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 16px;
  transition: all var(--transition);
}
.search-bar:focus-within {
  border-color: #498831;
  box-shadow: 0 0 0 3px rgba(73,136,49,0.08);
}
.search-bar input { flex: 1; border: none; outline: none; background: transparent; color: var(--text-dark); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-chip {
  padding: 6px 16px; border-radius: 99px; font-size: 0.8rem;
  background: var(--white); border: 1px solid rgba(45,90,27,0.15);
  cursor: pointer; color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1); font-weight: 500;
}
.filter-chip:hover, .filter-chip.active {
  background: linear-gradient(135deg, #E2F0D9, #f0f7eb);
  border-color: #498831; color: #2D5A1B;
}

/* --- Calendar Split --- */
.calendar-split { display: flex; gap: 16px; flex: 1; }
.calendar-left {
  width: 40%; background: var(--white); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(138,184,51,0.06);
}
.calendar-right {
  width: 60%; background: var(--white); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(138,184,51,0.06);
}
.calendar-left h4, .calendar-right h4 {
  font-size: 0.9rem; color: #2D5A1B; margin-bottom: 12px; font-weight: 600;
}

/* --- Livrables --- */
.livrables-mission-select {
  width: 100%; padding: 10px 14px; border: 1px solid rgba(45,90,27,0.15);
  border-radius: var(--radius); background: var(--white); color: var(--text-dark);
  margin-bottom: 16px; font-size: 0.9rem; transition: all var(--transition);
}
.livrables-mission-select:focus { border-color: #498831; box-shadow: 0 0 0 3px rgba(73,136,49,0.08); }
.livrables-progress {
  height: 8px; background: rgba(45,90,27,0.08); border-radius: 99px;
  margin-bottom: 16px; overflow: hidden;
}
.livrables-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #498831, #8AB833);
  border-radius: 99px; transition: width 0.4s var(--ease-out-expo);
}
.livrables-checklist {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(138,184,51,0.06);
}
.livrables-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(45,90,27,0.05); font-size: 0.9rem;
}
.livrables-item input[type="checkbox"] { accent-color: #498831; width: 16px; height: 16px; }

/* ========== SETTINGS PANEL ========== */
#settingsPanel {
  position: fixed; right: -420px; top: 0; bottom: 0; width: 400px;
  background: var(--white);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: -1px 0 0 rgba(0,0,0,0.04), -12px 0 40px rgba(0,0,0,0.1);
  z-index: 200; transition: right 0.4s var(--ease-out-expo); overflow-y: auto;
  padding: 32px;
  border-left: 1px solid rgba(138,184,51,0.06);
}
#settingsPanel.open { right: 0; }
.settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.settings-header h2 { font-family: var(--font-display); font-size: 1.2rem; color: #2D5A1B; font-weight: 700; }
[data-theme="dark"] .settings-header h2 { color: #8AB833; }
.settings-close {
  font-size: 1.3rem; cursor: pointer; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.settings-close:hover { background: rgba(45,90,27,0.06); color: var(--text-dark); }
.settings-section { margin-bottom: 28px; }
.settings-section h3 {
  font-size: 0.9rem; color: #2D5A1B; font-weight: 700; margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
[data-theme="dark"] .settings-section h3 { color: #8AB833; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(45,90,27,0.05);
  font-size: 0.85rem;
}
.settings-row label { color: var(--text-dark); }
.toggle-switch { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #ddd; border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.toggle-slider::before {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #498831, #2D5A1B);
}
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.font-size-slider { width: 100%; accent-color: #498831; }
.settings-feature-card {
  background: rgba(45,90,27,0.03); border-radius: var(--radius);
  padding: 14px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid rgba(45,90,27,0.05);
  transition: all var(--transition);
}
.settings-feature-card:hover { border-color: rgba(73,136,49,0.12); }
.settings-feature-card .feature-name { font-size: 0.85rem; font-weight: 600; }
.shortcuts-list { font-size: 0.8rem; }
.shortcuts-list .shortcut-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid rgba(45,90,27,0.05);
}
.shortcut-key {
  background: rgba(45,90,27,0.06); padding: 2px 8px; border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.72rem;
  border: 1px solid rgba(45,90,27,0.08);
}

/* ========== SUPER ADMIN ========== */
#superAdminPanel {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
#superAdminPanel.active { display: flex; }
.admin-modal {
  background: var(--white); border-radius: 24px;
  width: 90%; max-width: 900px; max-height: 85vh; overflow-y: auto;
  padding: 36px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(138,184,51,0.06);
  animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.admin-modal h2 {
  font-family: var(--font-display); font-size: 1.3rem;
  color: #2D5A1B; margin-bottom: 24px; letter-spacing: -0.02em;
}
[data-theme="dark"] .admin-modal h2 { color: #8AB833; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-tab {
  padding: 8px 18px; border-radius: 99px; font-size: 0.85rem;
  background: rgba(45,90,27,0.05); cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1); font-weight: 500;
}
.admin-tab:hover { background: rgba(45,90,27,0.1); }
.admin-tab.active {
  background: linear-gradient(135deg, #2D5A1B, #498831);
  color: #fff; box-shadow: 0 2px 8px rgba(45,90,27,0.2);
}
.admin-content { min-height: 300px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.admin-stat-card {
  background: rgba(45,90,27,0.03); border-radius: var(--radius);
  padding: 20px; text-align: center;
  border: 1px solid rgba(45,90,27,0.05);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.admin-stat-card:hover { border-color: rgba(73,136,49,0.15); transform: translateY(-2px); }
.admin-stat-card .stat-value {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 800; color: #2D5A1B; letter-spacing: -0.03em;
}
.admin-stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ========== COMMAND PALETTE ========== */
#commandPalette {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
}
#commandPalette.active { display: flex; }
.palette-container {
  background: var(--white); border-radius: var(--radius-lg);
  width: 90%; max-width: 560px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
  animation: scaleIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.palette-input-wrap {
  padding: 18px 20px; border-bottom: 1px solid rgba(45,90,27,0.08);
  display: flex; align-items: center; gap: 12px;
}
.palette-input-wrap .search-icon { font-size: 1.1rem; color: var(--text-muted); }
.palette-input {
  flex: 1; border: none; outline: none; font-size: 1rem;
  background: transparent; color: var(--text-dark);
}
.palette-results { max-height: 360px; overflow-y: auto; padding: 8px; }
.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.9rem;
  transition: all 0.12s cubic-bezier(0.22, 1, 0.36, 1);
}
.palette-item:hover, .palette-item.selected { background: rgba(73,136,49,0.08); }
[data-theme="dark"] .palette-item:hover, [data-theme="dark"] .palette-item.selected { background: rgba(138,184,51,0.1); }
.palette-item .palette-icon { width: 24px; text-align: center; }
.palette-item .palette-label { flex: 1; }
.palette-item .palette-shortcut {
  font-size: 0.72rem; color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: rgba(45,90,27,0.05); padding: 2px 6px; border-radius: 4px;
}

/* ========== CUSTOMIZE MODAL ========== */
#customizeModal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
#customizeModal.active { display: flex; }
.customize-card {
  background: var(--white); border-radius: 24px;
  padding: 36px; max-width: 480px; width: 90%;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(138,184,51,0.06);
  animation: scaleIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.customize-card h2 {
  font-family: var(--font-display); font-size: 1.2rem;
  color: #2D5A1B; margin-bottom: 24px;
}
.customize-card .widget-toggles { display: flex; flex-direction: column; gap: 8px; }
.customize-card .widget-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid rgba(45,90,27,0.05);
}
.customize-card .cust-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end; }
.customize-card .cust-btn {
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.85rem;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cust-btn.primary {
  background: linear-gradient(135deg, #2D5A1B, #498831); color: #fff;
  box-shadow: 0 2px 8px rgba(45,90,27,0.2);
}
.cust-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(45,90,27,0.3); }
.cust-btn.secondary { background: rgba(45,90,27,0.06); color: #2D5A1B; }
.cust-btn.secondary:hover { background: rgba(45,90,27,0.1); }

/* ========== FLOATING BUTTON ========== */
#floatingBtn {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #498831, #3a7023);
  color: #fff; font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(73,136,49,0.3), 0 8px 24px rgba(73,136,49,0.2);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s var(--ease-out-expo);
}
#floatingBtn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(73,136,49,0.35), 0 14px 36px rgba(73,136,49,0.25);
}
#floatingBtn:active { transform: translateY(-1px) scale(0.98); }
#floatingBtn .tooltip {
  position: absolute; bottom: 100%; right: 0; margin-bottom: 10px;
  background: rgba(26,26,26,0.92); color: #fff; padding: 6px 14px;
  border-radius: var(--radius-sm); font-size: 0.75rem; white-space: nowrap;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
  backdrop-filter: blur(4px);
}
#floatingBtn:hover .tooltip { opacity: 1; }

/* ========== INACTIVITY TOAST ========== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--white); border-radius: var(--radius-lg); padding: 16px 24px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
  z-index: 600; font-size: 0.9rem;
  display: flex; align-items: center; gap: 12px;
  transition: transform 0.4s var(--ease-out-expo);
  max-width: 90%;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast .toast-msg { color: var(--text-dark); }
.toast .toast-close {
  cursor: pointer; color: var(--text-muted); font-size: 1.2rem;
  transition: color var(--transition);
}
.toast .toast-close:hover { color: var(--text-dark); }

/* ========== ERROR BANNERS ========== */
.error-banner {
  background: linear-gradient(90deg, #2D5A1B, #3a6e22);
  color: #fff; padding: 12px 24px;
  text-align: center; font-size: 0.9rem; display: none;
  align-items: center; justify-content: center; gap: 12px;
}
.error-banner.visible { display: flex; }
.error-banner.offline { background: linear-gradient(90deg, #F59E0B, #f0b429); color: #333; }

/* ========== PWA INSTALL TOAST ========== */
#pwaToast {
  position: fixed; bottom: 90px; right: 24px; z-index: 600;
  background: var(--white); border-radius: var(--radius-lg);
  padding: 18px 22px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
  display: none; align-items: center; gap: 12px; max-width: 320px;
  animation: fadeSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
#pwaToast.visible { display: flex; }
#pwaToast .pwa-install-btn {
  padding: 8px 18px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #498831, #2D5A1B); color: #fff;
  font-weight: 600; font-size: 0.8rem; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(45,90,27,0.2);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
#pwaToast .pwa-install-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,90,27,0.3); }
#pwaToast .pwa-dismiss { color: var(--text-muted); cursor: pointer; font-size: 1.2rem; transition: color var(--transition); }
#pwaToast .pwa-dismiss:hover { color: var(--text-dark); }

/* ========== STAR & VOICE ========== */
.star-btn {
  position: relative; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--transition); font-size: 1.3rem;
  color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
}
.star-btn:hover {
  color: #fff; background: rgba(255,255,255,0.18);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.star-btn.recording { color: #8AB833; animation: starPulse 1.5s infinite; }
.star-btn.processing { color: #8AB833; animation: starBlink 0.6s infinite; }
.video-rec-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--transition); font-size: 1rem;
  color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
}
.video-rec-btn:hover {
  color: #fff; background: rgba(255,255,255,0.18);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.video-rec-btn.recording { color: #8AB833; animation: starPulse 1.5s infinite; }
/* Charte unifiee boutons audio header */
.audio-btn { transition: all var(--transition); }
.audio-btn:hover { color: #498831 !important; }
.audio-btn.active { color: #498831 !important; animation: starPulse 1.5s infinite; }
.audio-btn.active-alt { color: #8AB833 !important; animation: starPulse 1.5s infinite; }

/* --- Star Modal --- */
#starModal {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
#starModal.active { display: flex; }
.star-modal-body {
  background: var(--white); border-radius: 24px;
  width: 640px; max-width: 92vw; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(138,184,51,0.06);
  animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.star-modal-header {
  padding: 22px 28px; border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between;
}
.star-modal-header h2 {
  font-family: var(--font-display); font-size: 1.2rem;
  color: #2D5A1B; display: flex; align-items: center; gap: 8px;
}
.star-modal-content { padding: 24px 28px; }
.star-status { text-align: center; padding: 28px 0; }
.star-icon-big { font-size: 4rem; display: inline-block; transition: all 0.3s; }
.star-icon-big.idle { color: #9ca3af; }
.star-icon-big.rec { color: #498831; animation: starPulse 1.5s infinite; }
.star-icon-big.proc { color: #f39c12; animation: starBlink 0.6s infinite; }
.star-icon-big.done { color: #498831; }
.star-status-text { margin-top: 10px; font-size: 0.95rem; color: var(--text-muted); }
.star-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.8rem; color: #2D5A1B; margin-top: 8px; font-weight: 700;
}
.star-participants { margin-bottom: 16px; }
.star-participants input {
  width: 100%; padding: 12px 16px;
  border: 1px solid rgba(0,0,0,0.1); border-radius: var(--radius);
  font-size: 0.9rem; transition: all var(--transition);
}
.star-participants input:focus { border-color: #498831; box-shadow: 0 0 0 3px rgba(73,136,49,0.08); }
.star-transcript {
  background: rgba(45,90,27,0.03); border-radius: var(--radius);
  padding: 18px; min-height: 120px; max-height: 300px; overflow-y: auto;
  font-size: 0.85rem; line-height: 1.7; color: var(--text-dark);
  white-space: pre-wrap; margin: 12px 0;
  border-left: 3px solid #8AB833;
}
.star-actions { display: flex; gap: 10px; justify-content: center; padding: 18px 0; }
.star-actions button {
  padding: 10px 28px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.star-start-btn {
  background: linear-gradient(135deg, #498831, #2D5A1B); color: #fff;
  box-shadow: 0 2px 8px rgba(45,90,27,0.2);
}
.star-start-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(45,90,27,0.3); }
.star-stop-btn { background: #DC2626; color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,0.2); }
.star-stop-btn:hover { background: #b91c1c; transform: translateY(-2px); }
.star-export-btn {
  background: var(--green-light); color: #2D5A1B; border: 1px solid #498831;
}
.star-export-btn:hover { background: #498831; color: #fff; }
.star-results { margin-top: 16px; }
.star-results h3 { font-size: 1rem; color: #2D5A1B; margin-bottom: 10px; }
.star-doc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; background: rgba(45,90,27,0.03);
  border-radius: var(--radius); margin-bottom: 6px;
  border: 1px solid rgba(45,90,27,0.05);
  transition: all var(--transition);
}
.star-doc-item:hover { border-color: rgba(73,136,49,0.12); }
.star-doc-item .doc-icon { font-size: 1.3rem; }
.star-doc-item .doc-name { flex: 1; font-weight: 500; font-size: 0.9rem; }
.star-doc-item button {
  padding: 5px 14px; background: linear-gradient(135deg, #498831, #2D5A1B);
  color: #fff; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600;
  box-shadow: 0 2px 6px rgba(45,90,27,0.15);
}
.msg-listen-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px; font-size: 0.75rem;
  color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.msg-listen-btn:hover { color: #498831; background: rgba(73,136,49,0.08); }
.msg-listen-btn.speaking { color: #498831; font-weight: 600; }
.tts-controls { display: inline-flex; gap: 4px; margin-left: 4px; }
.tts-controls button { font-size: 0.75rem; padding: 1px 6px; border-radius: 4px; color: var(--text-muted); }
.tts-controls button:hover { color: #498831; }
.mute-indicator { display: none; align-items: center; gap: 4px; font-size: 0.75rem; color: #f39c12; padding: 0 8px; }
.mute-indicator.active { display: flex; }

/* ========== ARCHITECTURE NEURAL VIEW ========== */
#architectureView { display: none; flex-direction: column; height: 100%; padding: 24px; }
#architectureView.active { display: flex; }
.arch-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 20px;
}
.arch-header h2 {
  font-family: var(--font-display); color: #2D5A1B;
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.025em;
}
.arch-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.arch-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); }
.arch-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
#neuralCanvas {
  flex: 1; border-radius: var(--radius-lg); background: var(--white);
  box-shadow: var(--shadow-sm); cursor: grab;
  border: 1px solid rgba(138,184,51,0.06);
}
.arch-info {
  background: var(--white); border-radius: var(--radius);
  padding: 18px 22px; margin-top: 14px;
  box-shadow: var(--shadow-sm); display: none;
  border: 1px solid rgba(138,184,51,0.06);
  animation: fadeSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.arch-info.visible { display: block; }
.arch-info h3 { color: #2D5A1B; margin-bottom: 6px; font-size: 1rem; }
.arch-info p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ========== EMBEDS: Mermaid, Plotly, ECharts, Leaflet ========== */
.mermaid-container { border-radius: var(--radius); overflow: hidden; margin: 8px 0; }
.plotly-container { border-radius: var(--radius); overflow: hidden; margin: 8px 0; }
.echarts-container { border-radius: var(--radius); overflow: hidden; margin: 8px 0; }
.chart-toolbar {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(45,90,27,0.03); border-radius: var(--radius-sm);
}
.leaflet-container-wrap { border-radius: var(--radius); overflow: hidden; margin: 8px 0; }
.leaflet-map { width: 100%; min-height: 300px; }
.leaflet-legend {
  background: var(--white); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 0.8rem; box-shadow: var(--shadow-sm);
}
.col-resize-handle {
  width: 4px; cursor: col-resize; background: transparent;
  transition: background var(--transition); user-select: none;
}
.col-resize-handle:hover { background: rgba(73,136,49,0.2); }
body.resizing { cursor: col-resize !important; user-select: none !important; }

/* Sidebar tooltip (collapsed state) */
#sidebar.collapsed .sidebar-item { position: relative; justify-content: center; padding: 10px 0; }
#sidebar.collapsed .sidebar-item::after {
  content: attr(data-tooltip);
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  background: var(--color-primary); color: #FFFFFF;
  font-size: var(--font-size-xs); padding: 4px 8px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity var(--transition); z-index: 500; margin-left: 8px;
}
#sidebar.collapsed .sidebar-item:hover::after { opacity: 1; }

/* ========== PRINT ========== */
@media print {
  body { background: #fff !important; color: #000 !important; overflow: visible !important; }
  #sidebar, #header, #floatingBtn, #settingsPanel, .chat-input-top,
  .command-chips, .toast, #pwaToast, .error-banner { display: none !important; }
  #mainContent { background: #fff !important; }
  .widget, .chat-msg-bubble { box-shadow: none !important; border: 1px solid #ddd; }
  .doc-panel { border: none; }
  @page { margin: 2cm; }
  &::before { content: 'ADRIAL Conseils'; font-size: 1.2rem; font-weight: 700; display: block; margin-bottom: 16px; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .doc-panel { display: none; }
  .chat-input-btn { min-width: 44px; width: 44px; height: 44px; }
  .chat-content { padding: 20px; }
  #dashboardView { padding: 20px; }
}
@media (max-width: 768px) {
  #sidebar {
    position: fixed; left: -260px; width: 260px;
    top: var(--header-h); bottom: 0; z-index: 150;
    transition: left 0.35s var(--ease-out-expo);
    box-shadow: 8px 0 32px rgba(0,0,0,0.2);
  }
  #sidebar.mobile-open { left: 0; }
  #sidebar .sidebar-label { display: block; }
  .doc-panel { display: none; }
  .widgets-grid { grid-template-columns: 1fr; }
  .widget.span-2 { grid-column: span 1; }
  .calendar-split { flex-direction: column; }
  .calendar-left, .calendar-right { width: 100%; }
  #floatingBtn { bottom: 80px; right: 16px; }
  .chat-content { padding: 16px; }
  #dashboardView { padding: 16px; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .profiles-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .chat-msg { max-width: 92%; }
  .login-card-container { padding: 36px 24px 32px; border-radius: 24px; }
  .star-modal-body { border-radius: 20px; }
  .admin-modal { padding: 24px; border-radius: 20px; }
}

/* ========== BLOC 8 — ONGLETS DE CONVERSATIONS ========== */
.conversations-tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.conversations-tabs::-webkit-scrollbar { display: none; }
.conversation-tab {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.conversation-tab.active {
  background: var(--color-primary);
  color: #FFFFFF;
}
.conversation-tab:not(.active) {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.conversation-tab:not(.active):hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

/* ========== ANIMATIONS SUPPLÉMENTAIRES ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
@keyframes dash {
  to { stroke-dashoffset: -8; }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Transitions sur éléments interactifs */
a, button, input, textarea, select, [role="button"] {
  transition: all var(--transition);
}

/* ========== ÉTATS DE CHARGEMENT ========== */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg) 25%, rgba(255,255,255,0.6) 50%, var(--color-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.loading-state {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  font-family: var(--font-main);
  padding: var(--space-md);
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== REPRÉSENTATION GRAPHIQUE DES AGENTS ========== */
.agents-graph, .graph-container, [class*="agent-graph"], [class*="workflow"] {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  padding: var(--space-xl);
  animation: fadeIn 0.4s ease-in-out;
}
.agent-node {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-main);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  cursor: pointer;
}
.agent-node:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-hover);
}
.agent-connection, [class*="edge"], [class*="connector"] {
  stroke: var(--color-accent);
  stroke-width: 2px;
  stroke-dasharray: 4;
  animation: dash 1s linear infinite;
}
.agent-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}
.agent-status.active { background: rgba(138,184,51,0.15); color: var(--color-accent); }
.agent-status.idle { background: rgba(45,90,27,0.08); color: var(--color-text-light); }
.agent-status.working { background: rgba(73,136,49,0.15); color: var(--color-secondary); }

/* ========== NOTIFICATIONS ET TOASTS (override) ========== */
.toast .toast-msg, .notification { font-family: var(--font-main); }

/* ========== STYLES D'IMPRESSION (override) ========== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 12pt;
    font-family: var(--font-main);
  }
  .chat-msg.assistant .chat-msg-bubble {
    background: #FFFFFF !important;
    border: 1px solid #CCCCCC !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    max-width: 100% !important;
  }
  h1, h2, h3 {
    color: #000000 !important;
    page-break-after: avoid;
  }
  @page {
    margin: 2cm;
    size: A4;
  }
}

/* ========== v5 — CORRECTION 3 : CARTES LOGIN FOND BLANC ========== */
#loginPage .profile-card {
  background: #FFFFFF !important;
  border: 1.5px solid rgba(45,90,27,0.12) !important;
  color: #2D5A1B !important;
}
#loginPage .profile-card .profile-name { color: #2D5A1B !important; }
#loginPage .profile-card .profile-role { color: #4A6741 !important; }

/* ========== v5 — CORRECTION 6 : SIDEBAR COLLAPSED ALIGNEMENT ========== */
#sidebar.collapsed { width: var(--sidebar-collapsed-w); }
#sidebar.collapsed .sidebar-item {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px 0; margin: 0;
}
#sidebar.collapsed .sidebar-icon {
  margin: 0 auto; display: flex; align-items: center;
  justify-content: center; width: 24px; text-align: center;
}

/* ========== v5 — CORRECTION 9 : BARRE SAISIE FOND CLAIR ========== */
.chat-input-top, .chat-input-top input, .chat-input-top textarea {
  background: rgba(255,255,255,0.95) !important;
  color: var(--color-text) !important;
}
[data-theme="dark"] .chat-input-top,
[data-theme="dark"] .chat-input-top input,
[data-theme="dark"] .chat-input-top textarea {
  background: rgba(26,46,20,0.9) !important;
}

/* ========== v5 — CORRECTION 10/26 : SCORE DE CONFIANCE ========== */
.confidence-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
  margin-top: 8px; cursor: pointer;
  border: 1px solid rgba(0,0,0,0.08);
}
.confidence-badge.high   { background: #E8F5E9; color: #2D5A1B; border-color: #8AB833; }
.confidence-badge.medium { background: #FFF8E1; color: #E65100; border-color: #FFB300; }
.confidence-badge.low    { background: #FFEBEE; color: #C62828; border-color: #EF5350; }

/* ========== v5 — CORRECTION 21 : ARIA / ACCESSIBILITE ========== */
[aria-live="polite"] { position: relative; }

/* ========== BARRE DE SAISIE STYLE CLAUDE.AI ========== */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 2px solid #2D5A1B;
  border-radius: 24px;
  padding: 8px 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  position: relative;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.chat-input-bar:focus-within {
  border-color: #498831;
  box-shadow: 0 0 0 4px rgba(45,90,27,0.12);
}
.chat-input-bar textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-main);
  font-size: 15px;
  color: var(--color-text);
  resize: none;
  min-height: 24px;
  max-height: 200px;
  line-height: 1.5;
  padding: 4px 0;
  overflow-y: auto;
}
.chat-input-bar textarea::placeholder {
  color: #9CA3AF;
}
[data-theme="dark"] .chat-input-bar {
  background: #1A2E14;
  border-color: #498831;
}
[data-theme="dark"] .chat-input-bar textarea {
  color: #E2F0D9;
}
.input-bar-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 150ms ease;
  color: #6B7280;
  flex-shrink: 0;
}
.input-bar-btn:hover {
  background: rgba(45,90,27,0.08);
  color: #2D5A1B;
}
.input-bar-clip {
  font-size: 1.25rem;
}
.input-bar-send {
  background: #2D5A1B;
  color: #FFFFFF;
  font-size: 1.1rem;
}
.input-bar-send:hover {
  background: #498831;
  color: #FFFFFF;
  transform: scale(1.05);
}
/* Masquer l'ancienne barre */
.chat-input-top {
  display: none !important;
}
