/* =========================================================================
       1. ATLAS REFLEX™ LIGHT MODE OPTIMIZATIONS
       ========================================================================= */
    html:not(.dark) .reflex-metrics-grid .metric-card {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    html:not(.dark) .reflex-metrics-grid .metric-card > div > div:first-child {
      color: #64748b !important;
    }

    html:not(.dark) #reflex-stat-total {
      color: #0f172a !important;
    }

    html:not(.dark) .reflex-filters-panel {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    html:not(.dark) .reflex-filter-label {
      color: #475569 !important;
    }

    html:not(.dark) .reflex-filter-select,
    html:not(.dark) .reflex-filters-panel select {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .reflex-filter-select option,
    html:not(.dark) .reflex-filters-panel select option {
      background: #ffffff !important;
      color: #0f172a !important;
    }

    html:not(.dark) .reflex-filter-input,
    html:not(.dark) .reflex-filters-panel input[type="text"] {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .reflex-filter-input::placeholder,
    html:not(.dark) .reflex-filters-panel input::placeholder {
      color: #94a3b8 !important;
    }

    html:not(.dark) .reflex-filter-subbar {
      border-top: 1px solid #f1f5f9 !important;
    }

    html:not(.dark) .chip-status {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    html:not(.dark) .chip-status:hover {
      background: #f8fafc !important;
      border-color: #94a3b8 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .chip-status.active {
      background: #eef2ff !important;
      border-color: #6366f1 !important;
      color: #4f46e5 !important;
      font-weight: 700 !important;
    }

    html:not(.dark) .reflex-period-container {
      background: #f1f5f9 !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .btn-period {
      color: #64748b !important;
    }

    html:not(.dark) .btn-period:hover {
      color: #0f172a !important;
    }

    html:not(.dark) .btn-period.active {
      background: #ffffff !important;
      color: #0f172a !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    }

    html:not(.dark) .reflex-feed-container {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    html:not(.dark) #reflex-feed-empty {
      color: #64748b !important;
    }

    html:not(.dark) #reflex-feed-empty div:nth-child(2) {
      color: #0f172a !important;
    }

    html:not(.dark) .reflex-feed-row {
      border-bottom: 1px solid #f1f5f9 !important;
    }

    html:not(.dark) .reflex-feed-row:hover {
      background: #fafafa !important;
    }

    html:not(.dark) .reflex-agent-badge {
      background: #eef2ff !important;
      color: #4f46e5 !important;
      border-color: #c7d2fe !important;
    }

    html:not(.dark) .reflex-date-label {
      color: #64748b !important;
    }

    html:not(.dark) .reflex-query-title {
      color: #0f172a !important;
    }

    html:not(.dark) .reflex-user-comment {
      background: #fef2f2 !important;
      border-left: 3px solid #ef4444 !important;
      color: #991b1b !important;
    }

    html:not(.dark) .reflex-answer-card {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .reflex-answer-label {
      color: #475569 !important;
    }

    html:not(.dark) .reflex-preview-clickable {
      color: #334155 !important;
    }

    html:not(.dark) .btn-toggle-answer {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #2563eb !important;
    }

    html:not(.dark) .btn-toggle-answer:hover {
      background: #eff6ff !important;
      border-color: #93c5fd !important;
      color: #1d4ed8 !important;
    }

    html:not(.dark) .reflex-ans-full-box {
      border-top: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .reflex-markdown-body {
      color: #1e293b !important;
    }

    html:not(.dark) .reflex-markdown-body h1,
    html:not(.dark) .reflex-markdown-body h2,
    html:not(.dark) .reflex-markdown-body h3 {
      color: #0f172a !important;
    }

    html:not(.dark) .reflex-markdown-body blockquote {
      color: #334155 !important;
      background: rgba(56, 189, 248, 0.08) !important;
    }

    html:not(.dark) .reflex-corrected-box {
      background: #fffbeb !important;
      border: 1px solid #fde68a !important;
    }

    html:not(.dark) .reflex-corrected-title {
      color: #b45309 !important;
    }

    html:not(.dark) .reflex-corrected-text {
      color: #78350f !important;
    }

    html:not(.dark) .btn-reflex-verify {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    html:not(.dark) .btn-reflex-verify:hover {
      background: #f8fafc !important;
      border-color: #94a3b8 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .btn-reflex-correct {
      background: #fffbeb !important;
      border: 1px solid #fcd34d !important;
      color: #b45309 !important;
    }

    html:not(.dark) .btn-reflex-correct:hover {
      background: #fef3c7 !important;
      border-color: #f59e0b !important;
      color: #92400e !important;
    }

    /* Modal Correction Reflex */
    html:not(.dark) #modal-reflex-correct .modal-dialog {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
    }

    html:not(.dark) #modal-reflex-correct .modal-header {
      background: #f8fafc !important;
      border-bottom: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) #modal-reflex-correct .modal-header h3 {
      color: #0f172a !important;
    }

    html:not(.dark) #modal-reflex-correct [id="reflex-modal-agent-meta"] {
      color: #475569 !important;
    }

    html:not(.dark) #modal-reflex-correct [id="reflex-modal-agent-meta"] strong {
      color: #4f46e5 !important;
    }

    html:not(.dark) #modal-reflex-correct div[style*="background: rgba(255,255,255,0.03)"] {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) #reflex-modal-query-text {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
      color: #0f172a !important;
    }

    html:not(.dark) #reflex-modal-feedback-box {
      background: #fef2f2 !important;
      border: 1px solid #fecaca !important;
    }

    html:not(.dark) #reflex-modal-raw-answer {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
      color: #1e293b !important;
    }

    html:not(.dark) #reflex-modal-correction-input {
      background: #ffffff !important;
      border: 1.5px solid #f59e0b !important;
      color: #0f172a !important;
    }

    html:not(.dark) #modal-reflex-correct .modal-footer {
      background: #f8fafc !important;
      border-top: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) #modal-reflex-correct .modal-footer button:has(i[data-lucide="check"]) {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    html:not(.dark) #modal-reflex-correct .modal-footer button:not([class*="btn"]):first-of-type,
    html:not(.dark) #modal-reflex-correct .modal-footer button[onclick*="closeReflexCorrectModal"] {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    /* =========================================================================
       2. DÉPARTEMENTS & SERVICES LIGHT MODE OPTIMIZATIONS
       ========================================================================= */
    html:not(.dark) .departments-metrics-bar .metric-card {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    html:not(.dark) .departments-metrics-bar .metric-card div[style*="font-size: 0.8rem"] {
      color: #64748b !important;
    }

    html:not(.dark) #stat-dept-total {
      color: #0f172a !important;
    }

    html:not(.dark) #depts-filter-tabs .user-filter-pill {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    html:not(.dark) #depts-filter-tabs .user-filter-pill:hover {
      background: #f8fafc !important;
      border-color: #94a3b8 !important;
      color: #0f172a !important;
    }

    html:not(.dark) #depts-filter-tabs .user-filter-pill.active {
      background: #4f46e5 !important;
      border-color: #4338ca !important;
      color: #ffffff !important;
    }

    html:not(.dark) #depts-filter-tabs .user-filter-pill.active .pill-counter {
      background: rgba(255, 255, 255, 0.25) !important;
      color: #ffffff !important;
    }

    html:not(.dark) .department-card {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    html:not(.dark) .department-card:hover {
      border-color: #cbd5e1 !important;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
    }

    html:not(.dark) .dept-avatar-icon {
      background: #eff6ff !important;
      border-color: #bfdbfe !important;
      color: #2563eb !important;
    }

    html:not(.dark) .dept-card-title {
      color: #0f172a !important;
    }

    html:not(.dark) .dept-card-slug {
      background: #f1f5f9 !important;
      color: #475569 !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .dept-badge-system {
      background: #eff6ff !important;
      color: #1d4ed8 !important;
      border: 1px solid #bfdbfe !important;
    }

    html:not(.dark) .dept-badge-custom {
      background: #faf5ff !important;
      color: #7c3aed !important;
      border: 1px solid #e9d5ff !important;
    }

    html:not(.dark) .btn-dept-delete {
      background: #fef2f2 !important;
      border: 1px solid #fecaca !important;
      color: #b91c1c !important;
    }

    html:not(.dark) .btn-dept-delete:hover {
      background: #fee2e2 !important;
    }

    html:not(.dark) .dept-badge-collabs {
      background: #ecfdf5 !important;
      color: #047857 !important;
      border: 1px solid #a7f3d0 !important;
    }

    html:not(.dark) .dept-collabs-label {
      color: #64748b !important;
    }

    html:not(.dark) .dept-collabs-empty {
      background: #f8fafc !important;
      border: 1px dashed #cbd5e1 !important;
      color: #64748b !important;
    }

    html:not(.dark) .dept-collab-pill {
      background: #f1f5f9 !important;
      border: 1px solid #e2e8f0 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .dept-collab-role {
      color: #64748b !important;
    }

    html:not(.dark) .dept-card-footer {
      border-top: 1px solid #f1f5f9 !important;
    }

    html:not(.dark) .btn-dept-action {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #2563eb !important;
    }

    html:not(.dark) .btn-dept-action:hover {
      background: #eff6ff !important;
      border-color: #93c5fd !important;
      color: #1d4ed8 !important;
    }

    html:not(.dark) .dept-standard-label {
      color: #94a3b8 !important;
    }

    /* =========================================================================
       3. MODALE CONFIGURATION DU SUB-AGENT LIGHT MODE OPTIMIZATIONS
       ========================================================================= */
    html:not(.dark) .modal-stats-indexing-box {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .modal-stat-label {
      color: #64748b !important;
    }

    html:not(.dark) .modal-stat-value {
      color: #0f172a !important;
    }

    html:not(.dark) .modal-stat-value-delta {
      color: #059669 !important;
    }

    html:not(.dark) .modal-stats-tokens-box {
      background: #f0fdf4 !important;
      border: 1px solid #bbf7d0 !important;
    }

    html:not(.dark) .modal-token-label {
      color: #475569 !important;
    }

    html:not(.dark) .step-header-box {
      border-bottom: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .step-header-box h4 {
      color: #0f172a !important;
    }

    html:not(.dark) .step-header-box p {
      color: #64748b !important;
    }

    html:not(.dark) .archetype-card {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .archetype-card:hover {
      background: #f8fafc !important;
      border-color: #cbd5e1 !important;
      transform: translateY(-2px);
    }

    html:not(.dark) .archetype-card.active {
      background: #eef2ff !important;
      border: 1.5px solid #6366f1 !important;
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    }

    html:not(.dark) .archetype-title {
      color: #0f172a !important;
    }

    html:not(.dark) .archetype-desc {
      color: #475569 !important;
    }

    html:not(.dark) .archetype-badge {
      font-weight: 700 !important;
    }

    html:not(.dark) .modal-slug-box {
      background: #f1f5f9 !important;
      border: 1px solid #cbd5e1 !important;
      color: #0284c7 !important;
    }

    html:not(.dark) .modal-step-pane-container {
      background: #ffffff !important;
    }

    html:not(.dark) .modal-step-pane {
      background: #ffffff !important;
    }

    html:not(.dark) .modal-step-footer {
      background: #ffffff !important;
      border-top: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) #btn-details-prompt {
      background: #faf5ff !important;
      border: 1px solid #d8b4fe !important;
      color: #7c3aed !important;
    }

    html:not(.dark) #btn-details-prompt:hover {
      background: #f3e8ff !important;
      border-color: #c084fc !important;
      color: #6b21a8 !important;
    }

    html:not(.dark) #btn-details-prev:disabled {
      opacity: 0.5 !important;
      color: #94a3b8 !important;
      background: #f8fafc !important;
      border-color: #e2e8f0 !important;
    }

    /* Modale Sections Étape 2, 3, 4 */
    html:not(.dark) div[id="details-pane-2"] .form-group[style*="background: rgba(255, 255, 255, 0.02)"] {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) div[id="details-pane-2"] .form-group[style*="background: rgba(99, 102, 241, 0.04)"] {
      background: #f5f3ff !important;
      border: 1px solid #ddd6fe !important;
    }

    html:not(.dark) div[id="details-pane-2"] label[style*="color: #f1f5f9"] {
      color: #0f172a !important;
    }

    html:not(.dark) div[id="details-pane-3"] .form-group[style*="background: rgba(255, 255, 255, 0.02)"] {
      background: #f8fafc !important;
      border: 1px dashed #cbd5e1 !important;
    }

    html:not(.dark) div[id="details-pane-3"] label[style*="color: #93c5fd"] {
      color: #1d4ed8 !important;
    }

    html:not(.dark) div[id="details-pane-3"] label[style*="color: #c7d2fe"] {
      color: #4338ca !important;
    }

    html:not(.dark) #details-file-dropzone {
      background: #ffffff !important;
      border: 1px dashed #cbd5e1 !important;
      color: #64748b !important;
    }

    html:not(.dark) #details-token-estimate-box {
      background: #f0fdf4 !important;
      border: 1px solid #bbf7d0 !important;
    }

    html:not(.dark) #details-token-estimate-text {
      color: #059669 !important;
    }

    html:not(.dark) div[id="details-pane-4"] div[style*="background: rgba(16, 185, 129, 0.08)"] {
      background: #ecfdf5 !important;
      border: 1px solid #a7f3d0 !important;
    }

    html:not(.dark) div[id="details-pane-4"] div[style*="background: rgba(255,255,255,0.03)"] {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
      color: #0f172a !important;
    }

    html:not(.dark) div[id="details-pane-4"] div[style*="background: rgba(15, 23, 42, 0.75)"] {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) div[id="details-pane-4"] div[style*="background: rgba(255, 255, 255, 0.02)"] {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) div[id="details-pane-4"] label[style*="color: #f8fafc"] {
      color: #0f172a !important;
    }

    /* RBAC Choice Cards (Étape 5) */
    html:not(.dark) .rbac-choice-card {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    html:not(.dark) .rbac-choice-card:hover {
      background: #f8fafc !important;
      border-color: #94a3b8 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .rbac-choice-card:has(input[type="radio"]:checked),
    html:not(.dark) .rbac-choice-card.active {
      background: #eef2ff !important;
      border: 1.5px solid #6366f1 !important;
      color: #4338ca !important;
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    }

    html:not(.dark) #details-departments-wrap {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
    }

    /* Section droite du header */
    .header-right-section {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      margin-left: auto;
      flex-shrink: 0;
    }

    /* Badge Sécurité Souveraine */
    .security-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      background: rgba(16, 185, 129, 0.1);
      border: 1px solid rgba(16, 185, 129, 0.25);
      color: #10b981;
      padding: 4px 10px;
      border-radius: var(--radius-full);
      font-size: 0.72rem;
      font-weight: 600;
      user-select: none;
      white-space: nowrap;
    }

    html.dark .security-badge {
      color: #86efac;
    }

    .security-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: #10b981;
      box-shadow: 0 0 8px #10b981;
    }

    /* Badge Réassurance Ancilia Header */
    .ancilia-header-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      background: rgba(6, 182, 212, 0.08);
      border: 1px solid rgba(6, 182, 212, 0.25);
      color: #0891b2;
      padding: 4px 10px;
      border-radius: var(--radius-full);
      font-size: 0.72rem;
      font-weight: 600;
      user-select: none;
      white-space: nowrap;
      transition: all 0.2s ease;
      cursor: help;
    }

    .ancilia-header-badge:hover {
      background: rgba(6, 182, 212, 0.16);
      border-color: rgba(6, 182, 212, 0.45);
      box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
    }

    html.dark .ancilia-header-badge {
      background: rgba(6, 182, 212, 0.12);
      border-color: rgba(6, 182, 212, 0.3);
      color: #67e8f9;
    }

    .ancilia-header-badge .ancilia-shield-icon {
      font-size: 0.8rem;
      line-height: 1;
    }

    /* Badge Tag Ancilia sur les cartes d'agent */
    .pill-ancilia-tag {
      background: rgba(6, 182, 212, 0.1) !important;
      border-color: rgba(6, 182, 212, 0.35) !important;
      color: #22d3ee !important;
      font-weight: 600 !important;
    }

    /* Badge Tenant / Organisation Multi-Tenant */
    .tenant-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      color: var(--text-muted);
      padding: 4px 10px;
      border-radius: var(--radius-full);
      font-size: 0.72rem;
      font-weight: 600;
      max-width: 170px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Badge Compteur Tokens Restants */
    .tokens-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      padding: 4px 10px;
      border-radius: var(--radius-full);
      font-size: 0.72rem;
      font-weight: 600;
      white-space: nowrap;
      transition: all 0.2s ease;
      user-select: none;
      cursor: pointer;
    }

    .tokens-badge:hover {
      border-color: rgba(245, 158, 11, 0.4);
      background: rgba(245, 158, 11, 0.06);
    }

    .tokens-badge.warning {
      border-color: rgba(239, 68, 68, 0.4);
      color: #ef4444;
    }

    /* Bouton Bascule Dark / Light */
    .btn-theme-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border-color);
      background: var(--bg-surface);
      color: var(--text-muted);
      cursor: pointer;
      transition: all var(--transition-fast);
      flex-shrink: 0;
    }

    .btn-theme-toggle:hover {
      color: var(--text-main);
      background: var(--bg-hover);
      border-color: var(--text-dim);
    }

    .btn-theme-toggle .theme-icon-sun {
      display: none;
      width: 16px;
      height: 16px;
      color: #f59e0b;
    }

    .btn-theme-toggle .theme-icon-moon {
      display: block;
      width: 16px;
      height: 16px;
      color: #475569;
    }

    html.dark .btn-theme-toggle .theme-icon-sun {
      display: block;
    }

    html.dark .btn-theme-toggle .theme-icon-moon {
      display: none;
    }

    /* Menu Gaufre 9 Points */
    .app-switcher-container {
      position: relative;
    }

    .btn-app-switcher {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border-color);
      background: var(--bg-surface);
      color: var(--text-muted);
      cursor: pointer;
      transition: all var(--transition-fast);
      flex-shrink: 0;
    }

    .btn-app-switcher:hover,
    .btn-app-switcher.active {
      color: var(--text-main);
      background: var(--bg-hover);
      border-color: var(--text-dim);
    }

    .app-switcher-dropdown {
      position: absolute;
      top: calc(100% + 10px);
      right: 0;
      width: 380px;
      max-width: calc(100vw - 24px);
      box-sizing: border-box;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-jira);
      padding: 12px;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 8px;
      animation: appSwitcherFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
      overflow: hidden;
    }

    html.dark .app-switcher-dropdown {
      background: rgba(15, 23, 42, 0.96);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.12);
    }

    @keyframes appSwitcherFadeIn {
      from { opacity: 0; transform: translateY(-6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .app-switcher-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      padding: 4px 6px 8px 6px;
      border-bottom: 1px solid var(--border-subtle);
    }

    .app-switcher-title {
      font-size: 0.85rem;
      font-weight: 800;
      color: var(--text-main);
      letter-spacing: -0.01em;
    }

    .app-switcher-subtitle {
      font-size: 0.68rem;
      color: var(--text-dim);
      font-weight: 500;
    }

    .app-switcher-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      padding-top: 4px;
    }

    .app-switcher-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border-radius: var(--radius-lg);
      border: 1px solid transparent;
      text-decoration: none;
      transition: all var(--transition-fast);
      background: transparent;
      min-width: 0;
      box-sizing: border-box;
      outline: none;
    }

    .app-switcher-item:hover,
    .app-switcher-item:focus-visible {
      background: var(--bg-hover);
      border-color: var(--border-subtle);
      transform: translateY(-1px);
    }

    .app-switcher-item.active {
      background: var(--primary-tint);
      border-color: var(--primary-border);
    }

    .app-switcher-icon-box {
      width: 34px;
      height: 34px;
      border-radius: var(--radius-md);
      border: 1px solid transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .app-switcher-icon {
      width: 20px;
      height: 20px;
      object-fit: contain;
    }

    .app-switcher-item-info {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      min-width: 0;
      flex: 1;
    }

    .app-switcher-name-row {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      overflow: hidden;
    }

    .app-switcher-name {
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .app-switcher-active-tag {
      font-size: 0.6rem;
      font-weight: 700;
      color: #ffffff;
      background: #10b981;
      padding: 1px 4px;
      border-radius: 4px;
      text-transform: uppercase;
      line-height: 1;
      flex-shrink: 0;
    }

    .app-switcher-desc {
      font-size: 0.68rem;
      color: var(--text-dim);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .app-switcher-item-hub {
      grid-column: span 2;
      border-top: 1px solid var(--border-subtle);
      margin-top: 4px;
      padding-top: 10px;
    }

    /* Menu Compte Dinia (Google-style) */
    .account-menu-container {
      position: relative;
      display: inline-block;
    }

    .account-avatar-btn {
      background: none;
      border: 2px solid transparent;
      border-radius: 50%;
      padding: 2px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--transition-fast);
    }

    .account-avatar-btn:hover,
    .account-avatar-btn:focus-visible {
      border-color: var(--primary);
      transform: scale(1.05);
    }

    .account-avatar-btn .avatar-circle {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
      overflow: hidden;
      padding: 4px;
    }

    .avatar-picto-img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .btn-auth-header {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      padding: 6px 14px;
      border-radius: var(--radius-full);
      font-size: 0.78rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      transition: all var(--transition-fast);
    }

    .btn-auth-header:hover {
      background: var(--bg-hover);
      border-color: var(--text-dim);
    }

    /* Dropdown Profil Dinia Google-style */
    .account-dropdown {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 330px;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-xl);
      padding: 1.25rem;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      transform-origin: top right;
      animation: accountMenuIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .hidden,
    .account-dropdown.hidden,
    .app-switcher-dropdown.hidden {
      display: none !important;
    }

    @keyframes accountMenuIn {
      from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
      }
      to {
        opacity: 1;
        transform: scale(1) translateY(0);
      }
    }

    /* En-tête profil */
    .account-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 0.5rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border-color);
    }

    .account-large-avatar {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: #6366f1;
      color: #ffffff;
      font-size: 1.5rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }

    .account-user-name {
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--text-main);
      line-height: 1.2;
    }

    .account-user-email {
      font-size: 0.85rem;
      color: var(--text-muted);
      word-break: break-all;
    }

    .account-org-badge {
      font-size: 0.75rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-color);
      color: var(--text-muted);
      padding: 0.2rem 0.5rem;
      border-radius: var(--radius-full);
    }

    /* Statut Licence Atlas / Dinia */
    .account-license-box {
      background: rgba(16, 185, 129, 0.08);
      border: 1px solid rgba(16, 185, 129, 0.25);
      border-radius: var(--radius-md);
      padding: 0.75rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .license-info-left {
      display: flex;
      flex-direction: column;
      text-align: left;
    }

    .license-label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
      font-weight: 600;
    }

    .license-name {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text-main);
    }

    .license-status-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.75rem;
      font-weight: 600;
      padding: 0.25rem 0.6rem;
      border-radius: var(--radius-full);
      background: rgba(16, 185, 129, 0.2);
      color: #10b981;
    }

    .license-status-badge::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: currentColor;
    }

    /* Jauge Tokens Dinia Profil */
    .account-tokens-box {
      background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.03));
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 0.75rem;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .tokens-info-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.75rem;
    }

    .tokens-info-header .tokens-label {
      color: var(--text-muted);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.4px;
    }

    .tokens-info-header .tokens-value {
      font-weight: 700;
      color: var(--text-main);
    }

    .tokens-progress-bg {
      width: 100%;
      height: 5px;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 3px;
      overflow: hidden;
    }

    .tokens-progress-bar {
      height: 100%;
      background: linear-gradient(90deg, #6366f1 0%, #a855f7 60%, #f59e0b 100%);
      border-radius: 3px;
      transition: width 0.3s ease;
    }

    .tokens-progress-bar.low {
      background: #ef4444;
    }

    .tokens-axes-hint {
      font-size: 0.65rem;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      opacity: 0.85;
    }

    /* Actions du Popover Profil */
    .account-actions {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .btn-dinia-manage {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      width: 100%;
      padding: 0.65rem 1rem;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-color);
      background: var(--bg-hover);
      color: var(--text-main);
      font-size: 0.875rem;
      font-weight: 500;
      text-decoration: none;
      transition: all var(--transition-fast);
      box-sizing: border-box;
      cursor: pointer;
    }

    .btn-dinia-manage:hover {
      background: var(--bg-active);
      border-color: var(--primary);
      color: #ffffff;
    }

    .account-actions .btn-logout {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      width: 100%;
      padding: 0.5rem 1rem;
      border-radius: var(--radius-md);
      border: none;
      background: none;
      color: #ef4444;
      font-size: 0.85rem;
      cursor: pointer;
      transition: background var(--transition-fast);
    }

    .account-actions .btn-logout:hover {
      background: rgba(239, 68, 68, 0.1);
    }

    /* Bouton CTA Dinia SSO */
    .btn-dinia-sso-cta {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.65rem;
      width: 100%;
      padding: 0.75rem 1.25rem;
      border-radius: var(--radius-md);
      border: 1px solid rgba(255, 255, 255, 0.15);
      background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
      color: #ffffff;
      font-size: 0.95rem;
      font-weight: 600;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35);
      transition: all var(--transition-normal);
    }

    .btn-dinia-sso-cta:hover {
      transform: translateY(-1px);
      background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
      box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
    }

    .btn-dinia-sso-cta:active {
      transform: translateY(0);
    }

    .sso-or-divider {
      display: flex;
      align-items: center;
      text-align: center;
      color: var(--text-muted);
      font-size: 0.72rem;
      letter-spacing: 0.5px;
      font-weight: 600;
      margin: 0.5rem 0;
    }

    .sso-or-divider::before,
    .sso-or-divider::after {
      content: "";
      flex: 1;
      border-bottom: 1px solid var(--border-color);
    }

    .sso-or-divider span {
      padding: 0 0.75rem;
    }
