/* ==============================================================================
   BIMCOLLAB CDE STYLESHEET — GEDMEP (HAUTE LISIBILITÉ & FORTE DENSITÉ)
   Couleurs : Bandeau #0F172A, Sidebar #1E293B, Workspace #F8FAFC, Accent #2563EB
   ============================================================================== */

:root {
  --cde-topbar-bg: #0F172A;
  --cde-topbar-border: #1E293B;
  --cde-sidebar-bg: #1E293B;
  --cde-sidebar-hover: #27354A;
  --cde-sidebar-border: #334155;
  --cde-work-bg: #F8FAFC;
  --cde-card-bg: #FFFFFF;
  --cde-border-light: #E2E8F0;
  --cde-border-subtle: #CBD5E1;
  --cde-text-dark: #0F172A;
  --cde-text-main: #1E293B;
  --cde-text-muted: #64748B;
  --cde-primary: #2563EB;
  --cde-primary-hover: #1D4ED8;
}

/* Reset & Isolation du thème */
html body.cde-theme {
  height: 100vh !important;
  background-color: var(--cde-work-bg) !important;
  color: var(--cde-text-main) !important;
  margin: 0 !important;
  padding: var(--mt-nav-h, 42px) 0 0 0 !important;
  box-sizing: border-box !important;
  font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* ==============================================================================
   1. BANDEAU SUPÉRIEUR (#0F172A - HAUTEUR 48PX)
   ============================================================================== */
html body.cde-theme .cde-topbar {
  height: 48px !important;
  min-height: 48px !important;
  background: var(--cde-topbar-bg) !important;
  border-bottom: 1px solid var(--cde-topbar-border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 16px !important;
  color: #FFFFFF !important;
  z-index: 1000 !important;
  user-select: none !important;
}

html body.cde-theme .cde-topbar a {
  text-decoration: none !important;
}

.cde-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cde-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #FFFFFF !important;
  font-weight: 800;
  font-size: 14px;
}

.cde-badge-module {
  background: #0284C7;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.cde-project-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #E2E8F0;
}

.cde-project-tag {
  background: #2563EB;
  color: #FFFFFF;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
}

.cde-topbar-center {
  flex: 1;
  max-width: 440px;
  margin: 0 16px;
}

.cde-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.cde-search-bar input {
  width: 100%;
  height: 30px;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 6px;
  color: #FFFFFF !important;
  font-size: 12px;
  padding: 0 10px 0 32px;
  outline: none;
}

.cde-search-bar input:focus {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: #38BDF8 !important;
}

.cde-search-icon {
  position: absolute;
  left: 10px;
  font-size: 13px;
  color: #94A3B8;
  pointer-events: none;
}

.cde-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cde-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0 !important;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
}

.cde-nav-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF !important;
}

.cde-nav-btn-highlight {
  background: #0284C7 !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.cde-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.cde-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2563EB;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ==============================================================================
   2. CONTENEUR GLOBAL & SIDEBAR GAUCHE (#1E293B)
   ============================================================================== */
html body.cde-theme .cde-app-layout {
  display: flex !important;
  flex: 1 !important;
  height: calc(100vh - 48px) !important;
  width: 100vw !important;
  overflow: hidden !important;
  background-color: var(--cde-work-bg) !important;
}

html body.cde-theme .cde-sidebar {
  width: 250px !important;
  min-width: 250px !important;
  max-width: 250px !important;
  background: var(--cde-sidebar-bg) !important;
  border-right: 1px solid var(--cde-sidebar-border) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
  user-select: none !important;
  flex-shrink: 0 !important;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              min-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.18s ease !important;
}

html body.cde-theme .cde-sidebar.is-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-right: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.cde-toggle-collapse-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: #94A3B8;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 9px;
  transition: all 0.15s ease;
  line-height: 1;
}

.cde-toggle-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
}

.cde-topbar-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #E2E8F0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  margin-right: 4px;
  transition: all 0.15s ease;
}

.cde-topbar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border-color: #38BDF8;
}

.cde-btn-expand-sidebar {
  display: none !important;
  align-items: center;
  gap: 6px;
  background: #EFF6FF !important;
  border: 1px solid #BFDBFE !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #1D4ED8 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.cde-btn-expand-sidebar:hover {
  background: #DBEAFE !important;
  border-color: #93C5FD !important;
  color: #1E40AF !important;
  transform: translateX(1px);
}

html body.cde-theme.sidebar-is-collapsed .cde-btn-expand-sidebar {
  display: inline-flex !important;
}

html body.cde-theme.sidebar-is-collapsed #btn-topbar-sidebar-toggle {
  background: #2563EB !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
}

.cde-sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--cde-sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.cde-sidebar-badge {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.cde-tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cde-pole-group {
  border-radius: 6px;
  overflow: hidden;
}

.cde-pole-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: #CBD5E1;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.cde-pole-header:hover {
  background: var(--cde-sidebar-hover);
  color: #FFFFFF;
}

.cde-pole-header.is-active {
  background: #2563EB !important;
  color: #FFFFFF !important;
}

.cde-pole-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.cde-pole-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.cde-pole-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
}

.cde-pole-counter {
  background: #334155;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  flex-shrink: 0;
}

.cde-pole-header.is-active .cde-pole-counter {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.cde-subfolders-list {
  padding: 2px 0 4px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cde-subfolder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #94A3B8;
  font-size: 11px;
}

.cde-subfolder-row:hover {
  background: var(--cde-sidebar-hover);
  color: #F1F5F9;
}

.cde-subfolder-row.is-selected {
  background: rgba(37, 99, 235, 0.2) !important;
  color: #38BDF8 !important;
  font-weight: 600;
}

.cde-subfolder-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.cde-subfolder-tag {
  font-size: 9px;
  color: #64748B;
  background: #0F172A;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 6px;
}

/* ==============================================================================
   3. ZONE CENTRALE DE TRAVAIL CLAIRE (#F8FAFC / #FFFFFF)
   ============================================================================== */
html body.cde-theme .cde-workspace {
  flex: 1 !important;
  background: var(--cde-work-bg) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
  min-width: 0 !important;
}

/* Onglets ISO 19650 */
html body.cde-theme .cde-tabs-bar {
  background: #FFFFFF !important;
  border-bottom: 1px solid var(--cde-border-light) !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 20px !important;
  gap: 24px !important;
  height: 42px !important;
  min-height: 42px !important;
  user-select: none !important;
}

.cde-iso-tab {
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  color: #64748B !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 10px 0 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.cde-iso-tab:hover {
  color: #0F172A !important;
}

.cde-iso-tab.is-active {
  color: #2563EB !important;
  border-bottom-color: #2563EB !important;
  font-weight: 700 !important;
}

.cde-tab-count {
  background: #F1F5F9;
  color: #64748B;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.cde-iso-tab.is-active .cde-tab-count {
  background: #DBEAFE;
  color: #2563EB;
}

/* Barre d'Actions & Filtres Rapides */
html body.cde-theme .cde-actions-bar {
  background: #FFFFFF !important;
  border-bottom: 1px solid var(--cde-border-light) !important;
  padding: 10px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
}

.cde-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cde-btn-primary {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border: 1px solid #1D4ED8 !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

.cde-btn-primary:hover {
  background: #1D4ED8 !important;
}

.cde-filter-select {
  background: #FFFFFF !important;
  border: 1px solid var(--cde-border-light) !important;
  border-radius: 6px !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0F172A !important;
  outline: none !important;
  cursor: pointer !important;
}

.cde-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569 !important;
}

/* ==============================================================================
   4. TABLE DOCUMENTAIRE HAUTE DENSITÉ (#FFFFFF)
   ============================================================================== */
html body.cde-theme .cde-table-area {
  flex: 1 !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  padding: 16px 20px !important;
  background-color: var(--cde-work-bg) !important;
}

html body.cde-theme .cde-table-card {
  background: #FFFFFF !important;
  border: 1px solid var(--cde-border-light) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  min-width: 760px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html body.cde-theme .cde-docs-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 12px !important;
  background-color: #FFFFFF !important;
}

html body.cde-theme .cde-docs-table th {
  background: #F8FAFC !important;
  color: #475569 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 10px 10px !important;
  border-bottom: 1px solid var(--cde-border-light) !important;
  white-space: nowrap !important;
}

html body.cde-theme .cde-docs-table td {
  padding: 8px 10px !important;
  border-bottom: 1px solid var(--cde-border-light) !important;
  vertical-align: middle !important;
  height: 42px !important;
  background-color: #FFFFFF !important;
}

html body.cde-theme .cde-docs-table tr.cde-doc-row:hover td {
  background: #F1F5F9 !important;
}

html body.cde-theme .cde-docs-table tr.cde-doc-row.is-selected td {
  background: #EFF6FF !important;
}

/* Badges Format */
.cde-format-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.fmt-pdf  { background: #FEE2E2 !important; color: #DC2626 !important; border: 1px solid #FECACA !important; }
.fmt-ifc  { background: #DBEAFE !important; color: #2563EB !important; border: 1px solid #BFDBFE !important; }
.fmt-dwg  { background: #D1FAE5 !important; color: #059669 !important; border: 1px solid #A7F3D0 !important; }
.fmt-bcf  { background: #EDE9FE !important; color: #7C3AED !important; border: 1px solid #DDD6FE !important; }
.fmt-xls  { background: #FEF3C7 !important; color: #D97706 !important; border: 1px solid #FDE68A !important; }
.fmt-gen  { background: #F1F5F9 !important; color: #475569 !important; border: 1px solid #E2E8F0 !important; }

/* Nom de fichier ISO */
html body.cde-theme .cde-filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0F172A !important;
}

html body.cde-theme .cde-file-subtext {
  font-size: 11px !important;
  color: #64748B !important;
  margin-top: 2px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Pastilles ISO, Visa, Module */
.cde-pill-container {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
}
.cnt-wip       { background: #F1F5F9 !important; color: #475569 !important; border: 1px solid #CBD5E1 !important; }
.cnt-shared    { background: #EFF6FF !important; color: #1D4ED8 !important; border: 1px solid #93C5FD !important; }
.cnt-published { background: #ECFDF5 !important; color: #047857 !important; border: 1px solid #6EE7B7 !important; }
.cnt-archived  { background: #FFF7ED !important; color: #C2410C !important; border: 1px solid #FDBA74 !important; }

.cde-pill-visa {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
}
.visa-bpe { background: #D1FAE5 !important; color: #065F46 !important; border: 1px solid #34D399 !important; }
.visa-vso { background: #E0F2FE !important; color: #0369A1 !important; border: 1px solid #38BDF8 !important; }
.visa-vao { background: #FEF3C7 !important; color: #92400E !important; border: 1px solid #FCD34D !important; }
.visa-att { background: #F1F5F9 !important; color: #64748B !important; border: 1px solid #CBD5E1 !important; }
.visa-ref { background: #FEE2E2 !important; color: #991B1B !important; border: 1px solid #F87171 !important; }

.cde-pill-module {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #F8FAFC;
  border: 1px solid var(--cde-border-light);
  color: #1E293B;
}

.cde-pill-3d {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  background: #EFF6FF !important;
  color: #2563EB !important;
  border: 1px solid #BFDBFE !important;
  cursor: pointer;
}

.cde-pill-3d:hover {
  background: #2563EB !important;
  color: #FFFFFF !important;
}

.cde-action-icon-btn {
  background: #FFFFFF !important;
  border: 1px solid var(--cde-border-light) !important;
  border-radius: 5px;
  color: #475569 !important;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

.cde-action-icon-btn:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

/* ==============================================================================
   5. PANNEAU LATÉRAL DROIT D'INSPECTION (#FFFFFF - 380PX)
   ============================================================================== */
html body.cde-theme .cde-inspector-panel {
  width: 380px !important;
  min-width: 380px !important;
  max-width: 380px !important;
  background: #FFFFFF !important;
  border-left: 1px solid var(--cde-border-light) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.06) !important;
  transition: margin-right 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  margin-right: -380px !important;
  z-index: 50 !important;
}

html body.cde-theme .cde-inspector-panel.is-open {
  margin-right: 0 !important;
}

.cde-inspector-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cde-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC !important;
}

.cde-inspector-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cde-close-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #64748B;
  cursor: pointer;
  padding: 4px;
}

.cde-close-btn:hover {
  color: #0F172A;
}

.cde-inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #FFFFFF !important;
}

.cde-card-section {
  border: 1px solid var(--cde-border-light);
  border-radius: 8px;
  padding: 12px 14px;
  background: #FAFAFA !important;
}

.cde-section-title {
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: #0F172A !important;
  margin-bottom: 8px;
}

.cde-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--cde-border-light);
}

.cde-meta-label {
  color: #64748B !important;
}

.cde-meta-val {
  font-weight: 700 !important;
  color: #0F172A !important;
  text-align: right;
}

.cde-timeline {
  position: relative;
  padding-left: 18px;
  border-left: 2px solid var(--cde-border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.cde-timeline-item {
  position: relative;
  font-size: 11px;
}

.cde-timeline-dot {
  position: absolute;
  left: -24px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563EB;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #2563EB;
}

.cde-timeline-header {
  display: flex;
  justify-content: space-between;
  color: #475569 !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  margin-bottom: 2px;
}

.cde-timeline-title {
  font-weight: 700 !important;
  color: #0F172A !important;
}

.cde-timeline-desc {
  color: #475569 !important;
  margin-top: 2px;
}

/* ==============================================================================
   5. MODALES CHECK-IN & CHECK-OUT, BADGES DE VERSION & ACTIONS CONTEXTUELLES
   ============================================================================== */
.cde-btn-action {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cde-btn-action:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

.cde-btn-action-primary {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.cde-btn-action-primary:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
  color: #1E40AF;
}

.cde-btn-action-danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

.cde-btn-action-danger:hover {
  background: #FEE2E2;
  border-color: #F87171;
  color: #991B1B;
}

.cde-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #B45309;
}

.cde-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-family: ui-monospace, monospace;
}

.cde-version-badge.major {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.cde-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cde-modal-card {
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  animation: modalScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.cde-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
}

.cde-modal-body {
  padding: 18px;
  max-height: 75vh;
  overflow-y: auto;
}

.cde-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.cde-version-item {
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 10px 12px;
  background: #FFFFFF;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
}

.cde-version-item:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.cde-version-item.is-current {
  border-color: #93C5FD;
  background: #EFF6FF;
}

/* ==============================================================================
   PHASE 2 STYLES : CIRCUITS DE VISAS & STEPPERS & BORDEREAUX
   ============================================================================== */

.cde-stepper-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.cde-step-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 8px 10px;
  transition: all 0.15s ease;
}

.cde-step-row.is-active {
  border-color: #7C3AED;
  background: #F5F3FF;
}

.cde-step-row.is-approved {
  border-color: #A7F3D0;
  background: #F0FDF4;
}

.cde-step-row.is-rejected {
  border-color: #FECACA;
  background: #FEF2F2;
}

.cde-step-bullet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  background: #E2E8F0;
  color: #475569;
}

.cde-step-row.is-active .cde-step-bullet {
  background: #7C3AED;
  color: #FFFFFF;
}

.cde-step-row.is-approved .cde-step-bullet {
  background: #10B981;
  color: #FFFFFF;
}

.cde-step-row.is-rejected .cde-step-bullet {
  background: #EF4444;
  color: #FFFFFF;
}

.cde-step-status-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.cde-status-pending { background: #FEF3C7; color: #B45309; }
.cde-status-vso { background: #DCFCE7; color: #15803D; }
.cde-status-vao { background: #FEF9C3; color: #A16207; }
.cde-status-bpe { background: #DBEAFE; color: #1D4ED8; }
.cde-status-ref { background: #FEE2E2; color: #B91C1C; }

.cde-decision-box {
  margin-top: 10px;
  background: #FAF5FF;
  border: 1px solid #E9D5FF;
  border-radius: 6px;
  padding: 10px;
}

.cde-decision-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.cde-btn-decision {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.cde-btn-decision:hover {
  transform: translateY(-1px);
}

.cde-btn-decision.btn-vso:hover { background: #F0FDF4; border-color: #10B981; color: #047857; }
.cde-btn-decision.btn-vao:hover { background: #FEFCE8; border-color: #EAB308; color: #A16207; }
.cde-btn-decision.btn-bpe:hover { background: #EFF6FF; border-color: #3B82F6; color: #1D4ED8; }
.cde-btn-decision.btn-ref:hover { background: #FEF2F2; border-color: #EF4444; color: #B91C1C; }

.cde-tab-pending-visas.is-active {
  border-bottom-color: #EF4444 !important;
  color: #EF4444 !important;
}

/* ==============================================================================
   PHASE 3 : REGROUPEMENT STYLE SHAREPOINT, MÉTADONNÉES & OFFICE WOPI
   ============================================================================== */

.cde-group-header-row {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.cde-group-header-row:hover td {
  background-color: #E2E8F0 !important;
}

.cde-group-header-row td {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 8px 14px !important;
  border-bottom: 1px solid #CBD5E1 !important;
  border-top: 1px solid #CBD5E1 !important;
}

.cde-group-arrow {
  display: inline-block;
  font-size: 10px;
  color: #2563EB;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.cde-group-arrow.is-collapsed {
  transform: rotate(-90deg);
}

.cde-meta-input-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cde-meta-input-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.cde-meta-input {
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 12px;
  background: #FFFFFF;
  color: #0F172A;
  transition: border-color 0.15s;
}

.cde-meta-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.cde-view-selector-group {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}



/* ============================================================
   GEDMEP SPRINT 1 — CORRECTIFS MODALE DOE & RESPONSIVE < 900PX
   ============================================================ */
#cde-doe-modal .cde-modal-card {
  background: #FFFFFF !important;
  color: #0F172A;
  opacity: 1;
}
#cde-doe-modal input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  flex: 0 0 auto;
  cursor: pointer;
}
.cde-table-area {
  overflow-x: auto;
}
@media (max-width: 960px) {
  .cde-topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    padding: 6px 10px;
    gap: 6px;
  }
  .cde-topbar-center {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
  }
  .cde-tabs-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: thin;
  }
  .cde-iso-tab {
    flex-shrink: 0;
  }
}

/* ==============================================================================
   GEDMEP STUDIO ÉPURÉ — EXPLORATEUR WINDOWS 11 PRO (CLAIR / SOMBRE via tokens.css)
   ============================================================================== */

:root, [data-theme="dark"] {
  --ged-bg: #0B0F17;
  --ged-surface: rgba(17, 24, 39, 0.9);
  --ged-sidebar: rgba(15, 23, 42, 0.94);
  --ged-card: rgba(22, 31, 48, 0.84);
  --ged-row-hover: rgba(56, 189, 248, 0.08);
  --ged-border: rgba(148, 163, 184, 0.2);
  --ged-text: #F8FAFC;
  --ged-muted: #94A3B8;
  --ged-accent: #60CDFF;
  --ged-input: rgba(15, 23, 42, 0.72);
}

[data-theme="light"] {
  --ged-bg: #F3F6FA;
  --ged-surface: rgba(255, 255, 255, 0.94);
  --ged-sidebar: #F8FAFC;
  --ged-card: #FFFFFF;
  --ged-row-hover: #F1F5F9;
  --ged-border: rgba(15, 23, 42, 0.12);
  --ged-text: #0F172A;
  --ged-muted: #475569;
  --ged-accent: #0078D4;
  --ged-input: #F8FAFC;
}

html body.ged-studio {
  height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--ged-bg) !important;
  color: var(--ged-text) !important;
  font-family: var(--mep-font-sans, 'Segoe UI Variable', 'Inter', system-ui, sans-serif) !important;
}

/* 1. Barre supérieure unique 42px Fluent Acrylic */
.ged-topbar {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ged-surface) !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--ged-border);
  color: var(--ged-text) !important;
  z-index: 45;
  flex-shrink: 0;
}

.ged-top-left,
.ged-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ged-top-center {
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 380px;
}

.ged-icon-btn,
.ged-menu-btn,
.ged-btn-primary,
.ged-sub-pill,
.ged-sync-fab-btn {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--ged-border);
  background: transparent;
  color: var(--ged-text) !important;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.14s ease, filter 0.14s ease;
}
.ged-icon-btn:hover,
.ged-menu-btn:hover,
.ged-sub-pill:hover {
  background: rgba(148, 163, 184, 0.15);
}
.ged-btn-primary {
  background: #0078D4 !important;
  border-color: #0078D4 !important;
  color: #FFFFFF !important;
}
.ged-btn-primary:hover { filter: brightness(1.08); }

.ged-sync-fab-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(16, 185, 129, 0.2));
  border-color: rgba(16, 185, 129, 0.45);
  color: #10B981 !important;
  font-size: 11px;
}
[data-theme="light"] .ged-sync-fab-btn {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #047857 !important;
}

.ged-module-pill {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ged-accent);
  white-space: nowrap;
}
.ged-project-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: #0078D4;
  color: #FFFFFF;
}
.ged-project-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ged-muted);
  white-space: nowrap;
}
.ged-storage-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--ged-accent);
  white-space: nowrap;
}

.ged-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.ged-search-ico {
  position: absolute;
  left: 9px;
  font-size: 11px;
  opacity: 0.65;
  pointer-events: none;
}
.ged-search-input {
  width: 100%;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 10px 0 28px;
  border-radius: 7px;
  border: 1px solid var(--ged-border);
  background: var(--ged-input) !important;
  color: var(--ged-text) !important;
  font-size: 11.5px;
}

/* Menus déroulants Fluent */
.ged-menu-wrap { position: relative; }
.ged-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 245px;
  padding: 6px;
  border-radius: 10px;
  background: var(--ged-surface) !important;
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--ged-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 120;
}
.ged-dropdown[hidden] { display: none !important; }
.ged-dd-wide { min-width: 270px; }
.ged-dropdown > button,
.ged-dropdown #cde-selection-actions > button {
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--ged-text) !important;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ged-dropdown > button:hover,
.ged-dropdown #cde-selection-actions > button:hover {
  background: rgba(0, 120, 212, 0.16);
  color: var(--ged-accent) !important;
}
.ged-dd-sep {
  border: none;
  border-top: 1px solid var(--ged-border);
  margin: 4px 0;
}
.ged-dd-field {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ged-dd-field label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ged-muted);
}
.ged-dd-field select {
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--ged-border);
  background: var(--ged-input) !important;
  color: var(--ged-text) !important;
  font-size: 11.5px;
}

/* 2. Barre d'outils secondaire compacte (40px, 1 seule ligne) */
.ged-subbar {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ged-surface) !important;
  border-bottom: 1px solid var(--ged-border);
  flex-shrink: 0;
  overflow: hidden;
}
.ged-tabs-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
  min-width: 0;
}
.ged-tabs-strip::-webkit-scrollbar { display: none; }

body.ged-studio .cde-iso-tab {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 9px !important;
  border-radius: 7px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--ged-muted) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
body.ged-studio .cde-iso-tab.is-active {
  background: rgba(0, 120, 212, 0.16) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: var(--ged-accent) !important;
}
[data-theme="light"] body.ged-studio .cde-iso-tab.is-active {
  background: #E0F2FE !important;
  border-color: #0078D4 !important;
  color: #0078D4 !important;
}
body.ged-studio .cde-tab-count {
  font-size: 10px !important;
  padding: 1px 5px !important;
  border-radius: 99px !important;
  background: rgba(148, 163, 184, 0.2) !important;
  color: var(--ged-text) !important;
}
body.ged-studio .ged-tab-alert {
  background: #EF4444 !important;
  color: #FFFFFF !important;
}

.ged-subbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ged-count-label {
  font-size: 11px;
  color: var(--ged-muted);
  white-space: nowrap;
}

/* 3. Layout explorateur, Sidebar, Table & Inspecteur (Clair / Sombre) */
body.ged-studio .ged-app-layout {
  position: relative;
  flex: 1 1 auto !important;
  height: calc(100vh - var(--mt-nav-h, 42px) - 42px) !important;
  overflow: hidden !important;
  display: flex !important;
}
body.ged-studio .ged-sidebar {
  width: 235px !important;
  min-width: 235px !important;
  background: var(--ged-sidebar) !important;
  border-right: 1px solid var(--ged-border) !important;
  color: var(--ged-text) !important;
  transition: width 0.16s ease, min-width 0.16s ease;
}
body.ged-studio .ged-sidebar.is-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-right: none !important;
  overflow: hidden !important;
}
body.ged-studio .cde-sidebar-header {
  background: transparent !important;
  color: var(--ged-muted) !important;
  border-bottom: 1px solid var(--ged-border) !important;
}
/* Refonte Sobre & Fluide : Sidebar unifiée (spécificité 0,3,2), boutons sobres 2 niveaux, topbar allégée, focus clavier */
html body.cde-theme.ged-studio .cde-sidebar,
html body.cde-theme.ged-studio .ged-sidebar {
  background: var(--ged-sidebar) !important;
  color: var(--ged-text) !important;
  border-right: 1px solid var(--ged-border) !important;
}
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-sidebar-header,
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-sidebar-header span,
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-pole-header,
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-pole-title,
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-subfolder-row,
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-tree-pole-btn,
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-tree-sub-btn {
  color: #E2E8F0 !important;
}
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-pole-header:hover,
html:not([data-theme="light"]) body.cde-theme.ged-studio .cde-subfolder-row:hover {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #FFFFFF !important;
}
[data-theme="light"] body.cde-theme.ged-studio .cde-sidebar-header,
[data-theme="light"] body.cde-theme.ged-studio .cde-sidebar-header span,
[data-theme="light"] body.cde-theme.ged-studio .cde-tree-pole-btn,
[data-theme="light"] body.cde-theme.ged-studio .cde-tree-sub-btn,
[data-theme="light"] body.cde-theme.ged-studio .cde-pole-header,
[data-theme="light"] body.cde-theme.ged-studio .cde-pole-title,
[data-theme="light"] body.cde-theme.ged-studio .cde-subfolder-row {
  color: #1E293B !important;
}
[data-theme="light"] body.cde-theme.ged-studio .cde-pole-header:hover,
[data-theme="light"] body.cde-theme.ged-studio .cde-subfolder-row:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}
/* Allègement topbar : évite la répétition du projet déjà affiché dans la barre globale */
body.ged-studio #ged-project-tag,
body.ged-studio #ged-project-name,
body.ged-studio #ged-storage-pill {
  display: none !important;
}
body.ged-studio .ged-top-center {
  max-width: 440px !important;
}
/* Hiérarchie sobre à 2 niveaux : boutons secondaires neutres (zéro cyan/dégradé flashy) */
body.ged-studio .gvc-trigger-btn,
body.ged-studio .ged-menu-btn,
body.ged-studio .ged-icon-btn,
body.ged-studio .ged-sync-fab-btn {
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 6px !important;
  border: 1px solid var(--ged-border) !important;
  background: var(--ged-card) !important;
  color: var(--ged-text) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  transition: background 0.12s ease, border-color 0.12s ease !important;
}
body.ged-studio .gvc-trigger-btn:hover,
body.ged-studio .ged-menu-btn:hover,
body.ged-studio .ged-icon-btn:hover,
body.ged-studio .ged-sync-fab-btn:hover {
  background: var(--ged-row-hover) !important;
  border-color: var(--ged-accent) !important;
}
body.ged-studio .gvc-badge-pill {
  background: rgba(100, 116, 139, 0.2) !important;
  color: var(--ged-text) !important;
  font-weight: 600 !important;
}
body.ged-studio .gvc-badge-pill.is-alert {
  background: #DC2626 !important;
  color: #FFFFFF !important;
}
body.ged-studio button:focus-visible,
body.ged-studio a:focus-visible,
body.ged-studio input:focus-visible,
body.ged-studio select:focus-visible {
  outline: 2px solid var(--ged-accent) !important;
  outline-offset: 1px !important;
}
body.ged-studio .ged-tabs-strip {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
}
body.ged-studio .cde-modal-overlay {
  z-index: 10050 !important;
}
[data-theme="light"] body.ged-studio .cde-tree-pole-btn:hover,
[data-theme="light"] body.ged-studio .cde-tree-sub-btn:hover,
[data-theme="light"] body.ged-studio .cde-pole-header:hover,
[data-theme="light"] body.ged-studio .cde-subfolder-row:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}
body.ged-studio .cde-sidebar.is-collapsed ~ .ged-workspace #btn-expand-sidebar {
  display: inline-flex !important;
}
/* Thème sombre unifié pour les modales GedMEP & Circuits de Visas */
[data-theme="dark"] .gvc-modal,
[data-theme="dark"] .cde-modal-card {
  background: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .gvc-header,
[data-theme="dark"] .gvc-tabs,
[data-theme="dark"] .gvc-bar,
[data-theme="dark"] .gvc-kpi,
[data-theme="dark"] .gvc-stage,
[data-theme="dark"] .cde-modal-header,
[data-theme="dark"] .cde-modal-footer {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .gvc-card,
[data-theme="dark"] .gvc-rev,
[data-theme="dark"] .gvc-input,
[data-theme="dark"] .gvc-select,
[data-theme="dark"] .gvc-btn:not(.gvc-btn-primary) {
  background: #0B1220 !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .gvc-kpi-val,
[data-theme="dark"] .gvc-tab.is-active {
  color: #38BDF8 !important;
}

body.ged-studio .ged-workspace {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  background: var(--ged-bg) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
body.ged-studio .ged-table-area {
  flex: 1 1 auto !important;
  padding: 10px 12px !important;
  overflow: auto !important;
}
body.ged-studio .ged-table-card {
  background: var(--ged-card) !important;
  border: 1px solid var(--ged-border) !important;
  border-radius: 10px !important;
  overflow-x: auto !important;
}
body.ged-studio .cde-docs-table {
  width: 100% !important;
  min-width: 680px !important;
  color: var(--ged-text) !important;
}
body.ged-studio .cde-docs-table th {
  background: var(--ged-surface) !important;
  color: var(--ged-muted) !important;
  border-bottom: 1px solid var(--ged-border) !important;
  padding: 8px 8px !important;
  font-size: 10.5px !important;
}
body.ged-studio .cde-docs-table td {
  color: var(--ged-text) !important;
  border-bottom: 1px solid var(--ged-border) !important;
  padding: 7px 8px !important;
}
body.ged-studio .cde-docs-table tr:hover td {
  background: var(--ged-row-hover) !important;
}
body.ged-studio .cde-docs-table input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
}

/* 4. Inspecteur droit & Aperçu PDF/Image SANS CHEVAUCHEMENT + Tampon Visa */
body.ged-studio .ged-inspector {
  background: var(--ged-card) !important;
  border-left: 1px solid var(--ged-border) !important;
  color: var(--ged-text) !important;
}
body.ged-studio .cde-inspector-header {
  background: var(--ged-surface) !important;
  border-bottom: 1px solid var(--ged-border) !important;
  color: var(--ged-text) !important;
}
body.ged-studio .cde-inspector-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  overflow-y: auto !important;
  padding: 12px !important;
}
body.ged-studio .cde-inspector-body > * {
  flex-shrink: 0 !important;
}
body.ged-studio .ged-preview-card {
  position: relative !important;
  border: 1px solid var(--ged-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ged-surface);
  flex-shrink: 0;
}
body.ged-studio #ged-inline-pdf-preview {
  width: 100% !important;
  height: 195px !important;
  display: block !important;
  border: none !important;
  position: relative !important;
  z-index: 1 !important;
  background: #FFFFFF !important;
}

/* Tampon de Visa ISO 19650 horodaté */
.ged-visa-stamp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1.5px solid #10B981;
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  font-size: 11px;
  font-weight: 700;
}
.ged-visa-stamp.is-vao {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.14);
  color: #F59E0B;
}
.ged-visa-stamp.is-ref {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.14);
  color: #EF4444;
}
.ged-visa-stamp.is-att {
  border-color: #64748B;
  background: rgba(100, 116, 139, 0.12);
  color: var(--ged-muted);
}
[data-theme="light"] .ged-visa-stamp { color: #047857; background: #ECFDF5; }
[data-theme="light"] .ged-visa-stamp.is-vao { color: #92400E; background: #FFFBEB; }
[data-theme="light"] .ged-visa-stamp.is-ref { color: #991B1B; background: #FEF2F2; }
.ged-visa-stamp-meta {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.9;
}

/* Modale Visionneuse Quick Look */
.ged-quicklook-card {
  width: min(980px, 94vw);
  height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--ged-card) !important;
  color: var(--ged-text) !important;
  border: 1px solid var(--ged-border);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.ged-quicklook-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--ged-surface);
  border-bottom: 1px solid var(--ged-border);
}
.ged-quicklook-stamp-slot {
  padding: 8px 14px 0;
}
.ged-quicklook-body {
  flex: 1 1 auto;
  padding: 12px 14px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ged-bg);
}
.ged-quicklook-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 6px;
  background: #FFFFFF;
}
.ged-quicklook-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* Responsive 900x620 : zéro chevauchement, inspecteur flottant en superposition */
@media (max-width: 1150px) {
  body.ged-studio .ged-inspector.is-open {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(370px, 92vw) !important;
    z-index: 40 !important;
    box-shadow: -12px 0 36px rgba(0, 0, 0, 0.35);
  }
}
@media (max-width: 960px) {
  .ged-project-name,
  .ged-storage-pill,
  .ged-count-label { display: none !important; }
  .ged-icon-btn span { display: none; }
  #ged-dd-visas {
    left: auto !important;
    right: -60px !important;
    width: 260px !important;
    max-width: calc(100vw - 24px) !important;
  }
}

/* Suppression définitive de la barre redondante #golden-thread-bar en mode Studio Épuré */
body.ged-studio #golden-thread-bar,
#golden-thread-bar {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Fix badge ⚡ À valider dans .ged-subbar (zéro chevauchement à 900px) */
body.ged-studio .ged-subbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
}
body.ged-studio .cde-iso-tab .cde-badge-count,
body.ged-studio #tab-pending-visas .cde-tab-count {
  position: static !important;
  transform: none !important;
  margin-left: 4px !important;
}

/* Modale Quick Look au-dessus de tout */
#ged-quicklook-modal {
  z-index: 99999 !important;
}

/* Thème Sombre complet (Tableau, Inspecteur droit, Cartes & Champs) */
[data-theme="dark"] body.ged-studio .cde-table-wrapper,
[data-theme="dark"] body.ged-studio .cde-table-container,
[data-theme="dark"] body.ged-studio .cde-docs-table,
[data-theme="dark"] body.ged-studio .cde-docs-table tbody,
[data-theme="dark"] body.ged-studio .cde-docs-table tr,
[data-theme="dark"] body.ged-studio .cde-docs-table td,
[data-theme="dark"] body.ged-studio .ged-table-area,
[data-theme="dark"] body.ged-studio .ged-table-card,
[data-theme="dark"] body.ged-studio #ged-detail-drawer,
[data-theme="dark"] body.ged-studio .cde-detail-drawer,
[data-theme="dark"] body.ged-studio .ged-inspector,
[data-theme="dark"] body.ged-studio .cde-inspector-body {
  background: var(--ged-card) !important;
  color: var(--ged-text) !important;
  border-color: var(--ged-border) !important;
}
[data-theme="dark"] body.ged-studio .cde-docs-table thead,
[data-theme="dark"] body.ged-studio .cde-docs-table thead tr,
[data-theme="dark"] body.ged-studio .cde-docs-table thead th {
  background: var(--ged-surface) !important;
  color: var(--ged-muted) !important;
  border-bottom-color: var(--ged-border) !important;
}
[data-theme="dark"] body.ged-studio .cde-docs-table tbody tr:hover td {
  background: var(--ged-row-hover) !important;
}
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-inspector-header,
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-drawer-section,
[data-theme="dark"] body.ged-studio #ged-detail-drawer #drawer-custom-metadata-section,
[data-theme="dark"] body.ged-studio #ged-detail-drawer #drawer-versions-section,
[data-theme="dark"] body.ged-studio #ged-detail-drawer #drawer-workflow-section,
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-detail-card,
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-info-box,
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-meta-card,
[data-theme="dark"] body.ged-studio #ged-detail-drawer [style*="background:#F8FAFC"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer [style*="background: #F8FAFC"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer [style*="background:#FFFFFF"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer [style*="background: #FFFFFF"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer [style*="background: white"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer [style*="background:#fff"] {
  background: var(--ged-surface) !important;
  color: var(--ged-text) !important;
  border-color: var(--ged-border) !important;
}
[data-theme="dark"] body.ged-studio #ged-detail-drawer h2,
[data-theme="dark"] body.ged-studio #ged-detail-drawer h3,
[data-theme="dark"] body.ged-studio #ged-detail-drawer h4,
[data-theme="dark"] body.ged-studio #ged-detail-drawer #drawer-doc-filename,
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-inspector-title {
  color: #F8FAFC !important;
}
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-badge,
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-module-badge,
[data-theme="dark"] body.ged-studio #ged-detail-drawer .cde-version-pill {
  background: rgba(56, 189, 248, 0.16) !important;
  color: #E0F2FE !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}
[data-theme="dark"] body.ged-studio #ged-detail-drawer button:not(.ged-btn-primary):not(.cde-btn-primary):not(.cde-btn-danger) {
  background: var(--ged-input) !important;
  color: var(--ged-text) !important;
  border-color: var(--ged-border) !important;
}
[data-theme="dark"] body.ged-studio .cde-docs-table td,
[data-theme="dark"] body.ged-studio .cde-docs-table td strong,
[data-theme="dark"] body.ged-studio .cde-docs-table .cde-doc-name,
[data-theme="dark"] body.ged-studio .cde-docs-table .cde-file-name {
  color: #F1F5F9 !important;
}
[data-theme="dark"] body.ged-studio .cde-docs-table .cde-doc-meta,
[data-theme="dark"] body.ged-studio .cde-docs-table .cde-doc-sub,
[data-theme="dark"] body.ged-studio .cde-docs-table small {
  color: #94A3B8 !important;
}
[data-theme="dark"] body.ged-studio #ged-detail-drawer span[style*="background:#F1F5F9"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer span[style*="background: #F1F5F9"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer span[style*="background:#E2E8F0"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer span[style*="background: #E2E8F0"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer span[style*="background:#EFF6FF"],
[data-theme="dark"] body.ged-studio #ged-detail-drawer span[style*="background: #EFF6FF"] {
  background: rgba(56, 189, 248, 0.16) !important;
  color: #E0F2FE !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}
[data-theme="dark"] body.ged-studio #ged-detail-drawer input,
[data-theme="dark"] body.ged-studio #ged-detail-drawer select,
[data-theme="dark"] body.ged-studio #ged-detail-drawer textarea {
  background: var(--ged-input) !important;
  color: var(--ged-text) !important;
  border-color: var(--ged-border) !important;
}
[data-theme="dark"] body.ged-studio #ged-detail-drawer label,
[data-theme="dark"] body.ged-studio #ged-detail-drawer strong,
[data-theme="dark"] body.ged-studio #ged-detail-drawer h3,
[data-theme="dark"] body.ged-studio #ged-detail-drawer h4,
[data-theme="dark"] body.ged-studio #ged-detail-drawer p,
[data-theme="dark"] body.ged-studio #ged-detail-drawer span {
  color: inherit;
}
