/* ============================================================
   COLLECTE 2030 — Modern Design System (Linear / Vercel Dark Style)
   Font: Inter + Plus Jakarta Sans + JetBrains Mono
   ============================================================ */

:root {
  /* Surfaces — Deep Obsidian & Graphite */
  --bg-dark: #0a0b0e;
  --bg-surface: #12141a;
  --bg-surface-hover: #181b21;
  --bg-card: rgba(17, 19, 23, 0.8);
  --bg-card-alt: rgba(22, 24, 30, 0.65);
  --bg-elevated: #1a1d24;
  
  /* Precision 1px Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-bright: rgba(255, 255, 255, 0.22);
  
  /* Refined Restrained Accents */
  --primary: #ffffff;
  --primary-light: #e4e4e7;
  --primary-glow: rgba(255, 255, 255, 0);
  --brand-red: #e11d48;
  --brand-red-subtle: rgba(225, 29, 72, 0.12);
  --accent-cyan: #f4f4f6;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  
  /* Typography */
  --text-main: #f4f4f6;
  --text-muted: #8e939e;
  --text-dim: #555a66;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Radii & Realistic Soft Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 16px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 28px -4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Base reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* Background subtle lighting */
.ambient-glow {
  display: none !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 40% at 50% -10%, rgba(255, 255, 255, 0.035), transparent 70%);
  z-index: 0;
}

/* Gradient Text Helper */
.gradient-text {
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== APP LAYOUT & LEFT SIDEBAR NAVIGATION ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* SIDEBAR FIXE */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: #0b0d13;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  user-select: none;
}

.sidebar-brand {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-mark {
  background: #181a20;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.1px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-content::-webkit-scrollbar {
  width: 4px;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  padding: 16px 10px 6px;
}

.nav-section-label:first-child {
  padding-top: 2px;
}

.sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.sidebar-link .nav-icon {
  flex-shrink: 0;
  color: #64748b;
  transition: color 0.15s ease;
}

.sidebar-link .nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link:hover .nav-icon {
  color: #cbd5e1;
}

.sidebar-link.active {
  background: #171b26 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-link.active .nav-icon {
  color: #ffffff;
}

.sidebar-link .nav-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-left: auto;
}

.sidebar-link.active .nav-badge {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
}

.sidebar-link .nav-pill-tag {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
}

/* CONTENU PRINCIPAL CENTRÉ */
main.main-content {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-height: 100vh;
  padding: 40px 36px 80px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centre horizontalement toutes les sections */
}

/* Mobile topbar hidden on desktop */
.mobile-topbar {
  display: none;
}
.sidebar-backdrop {
  display: none;
}

.view {
  display: none;
  width: 100%;
  max-width: 1140px; /* Largeur de lecture optimale, parfaitement centrée */
  margin: 0 auto;
  animation: viewFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.view.active {
  display: block;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* View Header */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.badge-sub {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary-light);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.view-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.view-desc {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 780px;
  line-height: 1.6;
}

.counter-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Section Headings */
.section-intro {
  margin-bottom: 20px;
}
.section-heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.section-caption {
  font-size: 14px;
  color: var(--text-muted);
}
.mt40 { margin-top: 40px; }
.mt20 { margin-top: 20px; }
.mb10 { margin-bottom: 10px; }
.muted { color: var(--text-muted); }

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: #f4f4f6;
  color: #090a0d;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-medium);
}

.btn-copy {
  background: #181a20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-copy:hover {
  background: #22252c;
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}
.btn-copy.copied {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

/* ===== HERO SECTION ===== */
.hero-card {
  background: #12141a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--primary-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.pulsing-dot {
  width: 7px;
  height: 7px;
  background: #f4f4f6;
  border-radius: 50%;
  box-shadow: 0 0 8px #f4f4f6;
  
}
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 900px;
}

.hero-description {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 820px;
  margin-bottom: 32px;
}

.stats-row {
  display: flex;
  align-items: center;
  background: rgba(10, 15, 26, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  gap: 24px;
  flex-wrap: wrap; justify-content: center;
}
.stat-item {
  flex: 1;
  min-width: 140px;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-subtle);
}

/* ===== GRID SYSTEM ===== */
.grid {
  display: grid;
  gap: 20px;
}
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  position: relative;
}
.card:hover {
  border-color: var(--border-bright);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.card .icon {
  font-size: 26px;
  display: block;
  margin-bottom: 12px;
}

/* ===== FILTERS & SEARCH CONTAINER ===== */
.filter-wrapper {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.filter-pill {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.filter-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}
.filter-pill.active {
  background: #1e2433 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.search-container {
  position: relative;
  margin-bottom: 24px;
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  opacity: 0.6;
}
.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 14px 16px 14px 46px;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(18, 27, 44, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* ===== DOCUMENTS LIST & CARDS ===== */
.docs-grid-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  position: relative;
}
.doc-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-hover);
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.doc-title-group h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.015em;
}
.doc-filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.doc-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.badge-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: #fff;
}
.badge-subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.doc-summary {
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--primary-light);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 16px;
}

.doc-keypoints h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-light);
  margin-bottom: 10px;
}
.doc-keypoints ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.doc-keypoints li {
  font-size: 13.5px;
  color: var(--text-muted);
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.doc-keypoints li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-emerald);
  font-weight: 700;
  font-size: 13px;
}

/* Accordion */
details.doc-details {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 14px;
  margin-top: 14px;
}
details.doc-details summary {
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
details.doc-details summary::-webkit-details-marker { display: none; }
details.doc-details summary::after {
  content: '▸';
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 11px;
}
details.doc-details[open] summary::after {
  transform: rotate(90deg);
}
.doc-tech-box {
  margin-top: 12px;
  background: rgba(10, 16, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.doc-tech-row {
  margin-bottom: 8px;
}
.doc-tech-row strong {
  color: #fff;
}

.doc-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  user-select: none;
}
.btn-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-medium);
}
.btn-action.copied {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.btn-open-doc {
  background: #1e2433 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-open-doc:hover {
  background: #252d40 !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-open-doc svg {
  stroke: #ffffff;
}

.doc-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.doc-title-link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-file-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}
.doc-file-link:hover {
  color: #cbd5e1;
}

/* ===== NOTEBOOKLM ONBOARDING ===== */
.notebook-onboarding-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
}
.onboarding-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.onboarding-icon {
  font-size: 32px;
  background: rgba(255, 255, 255, 0.07);
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.3);
}
.onboarding-header h3 {
  font-family: var(--font-heading);
  font-size: 19px;
  color: #fff;
  margin-bottom: 4px;
}

.steps-flow {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}
.flow-step {
  flex: 1;
  min-width: 200px;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.step-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-light);
  background: rgba(255, 255, 255, 0.07);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.step-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.step-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  font-size: 14px;
}
.accent-link {
  color: var(--primary-light);
  text-decoration: none;
}
.accent-link:hover { text-decoration: underline; }

/* Notebook Packs */
.pack-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s;
}
.pack-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-hover);
}
.pack-card h4 {
  font-family: var(--font-heading);
  font-size: 17px;
  color: #fff;
  margin-bottom: 6px;
}
.pack-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.pack-docs-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pack-docs-tags span {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Prompt Card */
.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.25s;
}
.prompt-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-surface-hover);
}
.prompt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.prompt-category-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}
.prompt-card h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  color: #fff;
  margin-bottom: 8px;
}
.prompt-quote {
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(10, 15, 26, 0.6);
  border-left: 2px solid var(--primary-light);
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  line-height: 1.5;
}

/* ===== TIMELINE ===== */
.timeline-container {
  position: relative;
  padding: 20px 0;
}
.timeline-container::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #f4f4f6 0%, #a855f7 50%, #10b981 100%);
  border-radius: 2px;
}

.phase-node {
  position: relative;
  margin-bottom: 24px;
  cursor: pointer;
}
.phase-node .dot {
  position: absolute;
  left: 14px;
  top: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--primary-light);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.3s;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.3);
}
.phase-node:hover .dot, .phase-node.open .dot {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

.phase-node .phase-card {
  margin-left: 60px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.3s;
}
.phase-node:hover .phase-card {
  border-color: var(--border-bright);
}
.phase-node .phase-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  color: #fff;
}
.phase-node .phase-card .desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}
.phase-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.phase-node.open .phase-detail {
  max-height: 1400px;
}
.phase-detail .inner {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 14px;
}
.phase-detail .gate {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--accent-emerald);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
  font-size: 13.5px;
}
.phase-detail .gate strong { color: var(--accent-emerald); }
.agent-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  color: #fff;
  letter-spacing: 0.3px;
  display: inline-block;
}
.phase-detail .agents-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
  align-items: center;
}
.phase-detail ul {
  margin: 10px 0 10px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.phase-detail li { margin: 4px 0; }
.phase-detail .ot-list {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 12px 0;
}
.phase-detail .ot-list li {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--primary-light);
}

/* ===== QUIZ ===== */
.quiz-container {
  max-width: 720px;
  margin: 0 auto;
}
.quiz-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}
.quiz-progress .bar {
  height: 100%;
  background: linear-gradient(90deg, #f4f4f6, #818cf8);
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-q-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.quiz-q-text {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 24px;
  line-height: 1.5;
}
.quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(18, 27, 44, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 12px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  transition: all 0.2s;
}
.quiz-opt:hover {
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}
.quiz-opt.correct {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.15);
  color: #fff;
  font-weight: 600;
}
.quiz-opt.wrong {
  border-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
  color: #fff;
}
.quiz-explain {
  display: none;
  margin-top: 18px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-muted);
  border-left: 3px solid var(--primary-light);
  line-height: 1.6;
}
.quiz-explain.show { display: block; animation: viewFadeIn 0.3s; }

.quiz-result-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.quiz-score-num {
  font-family: var(--font-heading);
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
}
.quiz-score-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ===== CHECKLIST ===== */
.checklist-wrapper {
  max-width: 800px;
  margin: 0 auto;
}
.checklist-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}
.checklist-progress-bar .bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f4f4f6);
  border-radius: 4px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.check-item:hover {
  border-color: var(--primary-light);
  background: var(--bg-surface-hover);
}
.check-item .box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-dim);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.check-item.done .box {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.check-item.done .box::after { content: '✓'; }
.check-item.done .label {
  color: var(--text-dim);
  text-decoration: line-through;
}
.check-item .label {
  font-size: 14px;
  color: var(--text-main);
  flex-grow: 1;
  line-height: 1.5;
}
.check-item .cat-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* ===== GLOSSARY ===== */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.glossary-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 14px;
  transition: all 0.2s;
}
.glossary-item:hover {
  border-color: var(--primary-light);
  background: var(--bg-surface-hover);
  transform: translateX(4px);
}
.glossary-item .term {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-light);
}
.glossary-item .def {
  color: var(--text-muted);
}

/* ===== AGENTS ===== */
.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.25s;
}
.agent-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.agent-card .head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.agent-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.agent-card h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: #fff;
  margin: 0;
}
.agent-card .org {
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 600;
}
.agent-card .role {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.agent-card .tools {
  font-size: 12.5px;
  color: var(--text-dim);
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* ===== OTDR & RULES ===== */
.premium-card {
  padding: 24px;
}
.card-header-icon {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.icon-bubble {
  font-size: 20px;
  background: rgba(255, 255, 255, 0.06);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.otdr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.otdr-table th {
  background: rgba(0, 0, 0, 0.3);
  color: var(--primary-light);
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}
.otdr-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.otdr-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.otdr-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.otdr-steps-list .step {
  background: rgba(10, 15, 26, 0.6);
  border-left: 3px solid var(--primary-light);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: all 0.2s;
}
.rule-card:hover {
  border-left-color: var(--primary-light);
  transform: translateX(4px);
  background: var(--bg-surface-hover);
}
.rule-card .t {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.rule-card .d {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast-icon {
  background: var(--accent-emerald);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 18px;
    background: rgba(11, 13, 19, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 80;
  }
  .menu-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 120;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.85);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
  main.main-content {
    margin-left: 0;
    width: 100%;
    padding: 76px 20px 60px;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .hero-title { font-size: 28px; }
  .stats-row { flex-wrap: wrap; }
  .steps-flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); justify-content: center; margin: 4px 0; }
}

@media (max-width: 768px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .hero-card { padding: 24px 18px; }
  .view-title { font-size: 22px; }
  .doc-header { flex-direction: column; align-items: flex-start; }
}


/* ===== DOCUMENT THUMBNAILS ===== */
.doc-photos-preview {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.doc-photos-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-thumbs-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.doc-thumb-item {
  position: relative;
  width: 90px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: #000;
}
.doc-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.doc-thumb-item:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.doc-thumb-item:hover img {
  transform: scale(1.1);
}
.thumb-overlay-hint {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: #fff;
  font-size: 14px;
  transition: opacity 0.2s;
}
.doc-thumb-item:hover .thumb-overlay-hint {
  opacity: 1;
}

/* ===== PHOTO GALLERY SECTION ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.gallery-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.gallery-img-wrap {
  width: 100%;
  height: 190px;
  position: relative;
  overflow: hidden;
  background: #000;
}
.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-card:hover .gallery-img-wrap img {
  transform: scale(1.06);
}

.gallery-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(7, 11, 18, 0.85) 100%);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.25s;
}
.gallery-card:hover .gallery-hover-overlay {
  opacity: 1;
}
.gallery-zoom-badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid var(--primary-light);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gallery-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}
.gallery-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.gallery-cat-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--primary-light);
  padding: 3px 8px;
  border-radius: 4px;
}
.gallery-card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
}
.gallery-card-caption {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.gallery-doc-ref {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== LIGHTBOX MODAL — IMMERSION PLEIN ÉCRAN SANS 2ND CLIC ZOOM ===== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 10px;
}
.lightbox-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 9, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  width: 98vw;
  max-width: 1750px;
  height: 96vh;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transform: scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.lightbox-modal.show .lightbox-dialog {
  transform: scale(1);
}

.lightbox-close-btn {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.lightbox-close-btn:hover {
  background: #f43f5e;
  border-color: #f43f5e;
  transform: scale(1.08);
}

/* Nav Prev / Next */
.lightbox-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  background: rgba(18, 20, 26, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  width: 52px;
  height: 72px;
  border-radius: 12px;
  font-size: 34px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}
.lightbox-nav-btn:hover {
  background: #1e2433;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-50%) scale(1.06);
}
.lightbox-prev-btn { left: 16px; }
.lightbox-next-btn { right: 16px; }

/* Image Wrapper: Occupies maximum screen real estate */
.lightbox-img-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  min-height: 0;
  position: relative;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
  transition: all 0.2s ease;
}
.lightbox-img-wrapper img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: block;
  user-select: none;
  cursor: zoom-in;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

/* HINT PANORAMIQUE / SCHÉMA HD */
.lightbox-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 10;
  display: none;
  white-space: nowrap;
}
.lightbox-hint.show {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* MODE AGRANDI TAILLE RÉELLE (ZOOM 100% / PANORAMIQUE OU VERTICAL SCROLLABLE) */
.lightbox-modal.is-zoomed .lightbox-dialog {
  max-width: 99vw !important;
  width: 99vw !important;
}
.lightbox-modal.is-zoomed .lightbox-img-wrapper {
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-height: 84vh !important;
  display: flex !important;
  cursor: grab;
  padding: 16px 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.6) rgba(0, 0, 0, 0.6);
}
.lightbox-modal.is-zoomed .lightbox-img-wrapper.is-dragging {
  cursor: grabbing !important;
}

/* Base pour toute image zoomée */
.lightbox-modal.is-zoomed .lightbox-img-wrapper img {
  max-width: none !important;
  max-height: none !important;
  flex-shrink: 0 !important;
  cursor: zoom-out !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(56, 189, 248, 0.35);
}

/* Cas 1: Schémas panoramiques larges (ratio >= 2.0, ex: Synoptique Bus 400G) */
.lightbox-modal.is-zoomed.is-wide-img .lightbox-img-wrapper {
  align-items: center !important;
  justify-content: flex-start !important;
}
.lightbox-modal.is-zoomed.is-wide-img .lightbox-img-wrapper img {
  height: 76vh !important;
  min-height: 520px !important;
  width: auto !important;
  margin: auto 0;
}

/* Cas 2: Logigrammes verticaux & documents en hauteur (ratio <= 0.9, ex: 14 OT) */
.lightbox-modal.is-zoomed.is-tall-img .lightbox-img-wrapper {
  align-items: flex-start !important;
  justify-content: center !important;
}
.lightbox-modal.is-zoomed.is-tall-img .lightbox-img-wrapper img {
  width: min(92vw, 1380px) !important;
  min-width: 880px !important;
  height: auto !important;
  margin: 0 auto;
}

/* Cas 3: Photos et schémas standard (0.9 < ratio < 2.0) */
.lightbox-modal.is-zoomed.is-normal-img .lightbox-img-wrapper {
  align-items: center !important;
  justify-content: center !important;
}
.lightbox-modal.is-zoomed.is-normal-img .lightbox-img-wrapper img {
  width: min(1500px, 130vw) !important;
  height: auto !important;
  margin: auto;
}


/* Floating Caption Bar at Bottom */
.lightbox-meta {
  width: auto;
  max-width: 1180px;
  min-width: 320px;
  margin: 8px auto 0;
  background: rgba(18, 20, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}
.lightbox-meta-main {
  flex: 1;
  min-width: 0;
}
.lightbox-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3px;
}
.lightbox-meta h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: normal;
  line-height: 1.3;
}
.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.lightbox-meta p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox-source {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.lightbox-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lightbox-zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-zoom-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  transform: translateY(-1px);
}
.lightbox-zoom-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

/* ============================================================
   REFONTE ERGONOMIQUE DU TRAITEMENT DES DOCUMENTS (v3.1)
   - Progression d'apprentissage documentaire
   - Filtres par rôle métier & statut
   - Visionneuse universelle intégrée (PDF, Markdown TOC, PPTX)
   - Passerelles croisées Documents <-> Workflow
   ============================================================ */

/* PROGRESSION D'APPRENTISSAGE DOCUMENTAIRE */
.doc-progress-card {
  background: linear-gradient(135deg, rgba(18, 21, 28, 0.9) 0%, rgba(13, 15, 20, 0.95) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.doc-progress-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 320px;
}

.doc-progress-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-progress-info {
  flex: 1;
}

.doc-progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.doc-progress-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.doc-progress-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.doc-progress-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.doc-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.doc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 9999px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.doc-progress-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-dim);
}

.doc-progress-sub strong {
  color: #f1f5f9;
}

.doc-progress-reset-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
  padding: 0;
}
.doc-progress-reset-btn:hover {
  color: #f43f5e;
}

.doc-status-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-medium);
}
.status-filter-pill.active {
  background: #ffffff;
  color: #0b0d13;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

/* FILTRES PAR PROFIL MÉTIER */
.filter-wrapper-roles {
  margin-top: 10px;
  margin-bottom: 18px;
}

.filter-roles-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-right: 4px;
  display: flex;
  align-items: center;
}

.role-filter-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.role-filter-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.role-filter-pill.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: var(--border-bright);
}
.role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* ENRICHISSEMENT DES CARTES DOCUMENTAIRES */
.doc-card.is-studied {
  border-color: rgba(16, 185, 129, 0.28);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(18, 20, 26, 0.8) 100%);
}

.card-read-toggle-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.card-read-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.card-read-toggle-btn.is-read {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.card-read-icon {
  font-weight: 800;
  font-size: 11px;
}

.doc-phases-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.doc-phases-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.doc-phase-tag {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}
.doc-phase-tag:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn-primary-action {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  font-weight: 600;
}
.btn-primary-action:hover {
  background: #38bdf8 !important;
  color: #0b0d13 !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

/* PASSERELLES CROISÉES WORKFLOW -> DOCUMENTS */
.phase-docs-section {
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.phase-docs-label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.phase-docs-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-doc-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}
.timeline-doc-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  transform: translateY(-1px);
}
.timeline-doc-chip.is-read {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.timeline-doc-chip.is-read .chip-status-icon {
  color: #34d399;
  font-weight: 800;
}
.chip-status-icon {
  font-size: 11px;
}

/* ===== VISIONNEUSE UNIVERSELLE DE DOCUMENTS MODAL ===== */
.doc-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}
.doc-viewer-modal.show {
  opacity: 1;
  visibility: visible;
}

.doc-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.doc-viewer-dialog {
  position: relative;
  z-index: 1000;
  width: 96vw;
  height: 94vh;
  max-width: 1560px;
  background: #0b0d13;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(13, 16, 23, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  gap: 16px;
  flex-shrink: 0;
}

.doc-viewer-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.doc-viewer-type-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  flex-shrink: 0;
}

.doc-viewer-title-group h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-viewer-meta-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.doc-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-viewer-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  color: #e2e8f0;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-viewer-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--border-bright);
}

.btn-viewer-toggle-read.is-read {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.btn-viewer-toggle-read .viewer-check-icon {
  font-weight: 800;
}

.doc-viewer-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.doc-viewer-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #f43f5e;
}

.doc-viewer-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
}

.doc-viewer-loading, .doc-viewer-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  gap: 16px;
  padding: 40px;
}

.viewer-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* PDF IFRAME WRAPPER */
.doc-viewer-pdf-wrap {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #12141a;
}
.doc-viewer-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #181b21;
}

/* MARKDOWN SPLIT VIEW */
.doc-viewer-split {
  flex: 1;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.doc-viewer-sidebar-toc {
  width: 290px;
  background: #0d0f16;
  border-right: 1px solid var(--border-subtle);
  padding: 20px 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.toc-header {
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toc-link {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #94a3b8;
  text-decoration: none;
  line-height: 1.4;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.toc-link.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  font-weight: 600;
}
.toc-level-1 { font-weight: 600; color: #f1f5f9; }
.toc-level-2 { padding-left: 18px; }
.toc-level-3 { padding-left: 28px; font-size: 11.5px; }

.doc-viewer-article {
  flex: 1;
  overflow-y: auto;
  padding: 36px 54px;
  max-width: 980px;
  margin: 0 auto;
  line-height: 1.7;
}

.doc-viewer-doc-banner {
  padding-bottom: 24px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-subtle);
}
.doc-banner-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #38bdf8;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.doc-viewer-doc-banner h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

/* TYPOGRAPHIE MARKDOWN */
.md-heading {
  font-family: var(--font-heading);
  color: #fff;
  margin: 32px 0 14px;
  scroll-margin-top: 24px;
  position: relative;
}
.md-h1 { font-size: 24px; font-weight: 800; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }
.md-h2 { font-size: 20px; font-weight: 700; color: #f8fafc; }
.md-h3 { font-size: 16px; font-weight: 600; color: #e2e8f0; }
.md-h4 { font-size: 14px; font-weight: 600; color: #cbd5e1; }

.md-anchor-link {
  opacity: 0;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  margin-left: 6px;
  transition: opacity 0.2s;
}
.md-heading:hover .md-anchor-link {
  opacity: 0.8;
}

.md-p {
  font-size: 14.5px;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.md-list {
  margin: 0 0 16px 22px;
  color: #cbd5e1;
  font-size: 14.5px;
}
.md-list li {
  margin-bottom: 6px;
}

.md-inline-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.md-code-block {
  background: #080a0f;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 18px 0;
}
.md-code-block code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #f1f5f9;
  line-height: 1.5;
}

.md-blockquote {
  border-left: 3px solid #38bdf8;
  padding: 12px 18px;
  background: rgba(56, 189, 248, 0.05);
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
  font-size: 14px;
  color: #cbd5e1;
}

.md-table-wrap {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.md-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 11px 16px;
  text-align: left;
  color: #fff;
  font-weight: 700;
  border-bottom: 1px solid var(--border-medium);
}
.md-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: #cbd5e1;
}
.md-table tr:last-child td {
  border-bottom: none;
}
.md-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* PPTX PRESENTATION SUMMARY CARD */
.doc-viewer-pptx-card {
  padding: 48px;
  max-width: 960px;
  margin: 0 auto;
  overflow-y: auto;
  width: 100%;
}

.pptx-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.pptx-icon {
  font-size: 48px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 108, 0, 0.12);
  border: 1px solid rgba(239, 108, 0, 0.3);
  border-radius: 16px;
  flex-shrink: 0;
}
.pptx-hero h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.pptx-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.pptx-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
}
.pptx-box h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}
.pptx-box ul {
  padding-left: 18px;
  color: #cbd5e1;
  font-size: 13.5px;
}
.pptx-box li {
  margin-bottom: 8px;
}

.pptx-actions-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

/* RESPONSIVE MOBILE (< 960px) */
@media (max-width: 960px) {
  .doc-viewer-dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
  }
  .doc-viewer-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 10px;
  }
  .doc-viewer-actions {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .doc-viewer-split {
    flex-direction: column;
  }
  .doc-viewer-sidebar-toc {
    width: 100%;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px;
  }
  .doc-viewer-article {
    padding: 20px 16px;
  }
  .pptx-grid {
    grid-template-columns: 1fr;
  }
  .pptx-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-progress-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .doc-progress-main {
    min-width: 100%;
  }
  .doc-status-filters {
    width: 100%;
    justify-content: space-between;
  }
}
/* ============================================================
   DOCUMENTS PDF — Modern Linear/Obsidian Ergonomics
   ============================================================ */

/* --- Header Stats & Progress Chip --- */
.doc-header-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.doc-progress-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 12px;
  user-select: none;
}

.doc-progress-chip-bar {
  width: 54px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.doc-progress-chip-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 9999px;
  transition: width 0.35s ease;
}

.doc-progress-chip-text {
  color: var(--text-muted);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.doc-progress-reset-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s ease, transform 0.25s ease;
}
.doc-progress-reset-btn:hover {
  color: #f43f5e;
  transform: rotate(-90deg);
}

/* --- Command Panel: Search & Filters --- */
.doc-controls-panel {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doc-search-box {
  position: relative;
  margin-bottom: 0;
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.search-clear-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.doc-filter-wrapper {
  margin-bottom: 0;
}

/* Secondary Sub-filters Bar */
.doc-subfilters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
}

.doc-subfilter-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subfilter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}

.subfilter-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.subfilter-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.subfilter-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.subfilter-pill.active {
  background: #1e2433;
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 600;
}

.role-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.doc-subfilter-sep {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
}

.doc-reset-filters-link {
  background: transparent;
  border: none;
  color: #f43f5e;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.doc-reset-filters-link:hover {
  background: rgba(244, 63, 94, 0.1);
  text-decoration: underline;
}

/* --- Refined Document Cards --- */
.docs-grid-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.doc-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-hover);
}

.doc-card.is-studied {
  border-left: 3px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.035) 0%, rgba(18, 20, 26, 0.8) 100%);
}

/* Card Header Top */
.doc-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-meta-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.doc-meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.badge-subtle.font-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Study Toggle Button */
.doc-study-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.doc-study-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-medium);
}

.doc-study-btn.is-read {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.study-check-box {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
}

.doc-study-btn.is-read .study-check-box {
  background: #10b981;
  border-color: #10b981;
  color: #0b0d13;
}

/* Title */
.doc-title {
  margin: 2px 0 0 0;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.015em;
}

.doc-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.doc-title-link:hover {
  color: #38bdf8;
}

/* Workflow Phases Gateway */
.doc-phases-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-phases-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.doc-phases-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-phase-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.doc-phase-chip:hover {
  background: #1e2433;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(1px);
}

/* Summary Text */
.doc-summary-text {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

/* Keypoints Box */
.doc-keypoints-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.keypoints-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.keypoints-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keypoints-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.kp-icon {
  color: #10b981;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Photos Preview Section */
.doc-photos-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photos-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.doc-photos-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.doc-photo-thumbnail {
  position: relative;
  width: 80px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
  flex-shrink: 0;
  background: #000;
  transition: all 0.2s ease;
}

.doc-photo-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.doc-photo-thumbnail:hover {
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.doc-photo-thumbnail:hover img {
  opacity: 1;
  transform: scale(1.06);
}

.photo-caption-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.78);
  font-size: 9px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}

/* IMAGES CLIQUABLES DANS LA VISIONNEUSE DE DOCUMENT */
.clickable-doc-img {
  cursor: zoom-in !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  max-width: 100%;
}
.clickable-doc-img:hover {
  transform: scale(1.015);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.md-article-img-wrap {
  margin: 16px 0;
  display: inline-flex;
  flex-direction: column;
  max-width: 100%;
}
.md-img-caption {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 6px;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}
.md-img-caption::before {
  content: "🔍";
  font-size: 10px;
  font-style: normal;
}

/* BANDEAU PHOTOS & SCHÉMAS DANS LA VISIONNEUSE MODALE */
.doc-viewer-photos-strip {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 24px;
}
.doc-viewer-photos-strip-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.doc-viewer-photos-strip-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.doc-viewer-photo-card {
  position: relative;
  width: 140px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  cursor: zoom-in;
  flex-shrink: 0;
  background: #000;
  transition: all 0.2s ease;
}
.doc-viewer-photo-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}
.doc-viewer-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.doc-viewer-photo-card span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.82);
  font-size: 10px;
  color: #f1f5f9;
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}

/* BANDEAU PHOTOS POUR PDF DANS LA VISIONNEUSE */
.doc-viewer-pdf-photos-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: #080a0f;
  border-bottom: 1px solid var(--border-medium);
  overflow-x: auto;
  flex-shrink: 0;
}
.pdf-bar-title {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pdf-bar-thumbs {
  display: flex;
  gap: 10px;
}
.pdf-thumb-btn {
  position: relative;
  width: 100px;
  height: 60px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  cursor: zoom-in;
  flex-shrink: 0;
  background: #000;
  transition: all 0.2s ease;
}
.pdf-thumb-btn:hover {
  border-color: var(--color-primary);
  transform: scale(1.04);
}
.pdf-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.pdf-thumb-btn span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  font-size: 9px;
  color: #f1f5f9;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}

/* Actions Footer */
.doc-actions-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2px;
}

.btn-doc-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #1e2433 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-doc-primary:hover {
  background: #252d40 !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-doc-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-doc-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-medium);
}
