/* Support Thème Sombre & Clair */
    html.dark {
      --bg-primary: #080c14;
      --bg-sidebar: #0d121f;
      --bg-card: rgba(15, 23, 42, 0.75);
      --bg-surface: rgba(15, 23, 42, 0.96);
      --bg-hover: rgba(30, 41, 59, 0.7);
      --border-color: rgba(255, 255, 255, 0.08);
      --border-subtle: rgba(255, 255, 255, 0.06);
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
    }

    html:not(.dark) {
      --bg-primary: #f8fafc;
      --bg-sidebar: #ffffff;
      --bg-card: #ffffff;
      --bg-card-hover: #f8fafc;
      --bg-surface: #ffffff;
      --bg-hover: #f1f5f9;
      --bg-active: #e2e8f0;
      --border-color: #e2e8f0;
      --border-subtle: #f1f5f9;
      --text-main: #0f172a;
      --text-muted: #475569;
      --text-dim: #64748b;
      --primary-glow: rgba(99, 102, 241, 0.15);
      --emerald-glow: rgba(16, 185, 129, 0.15);
    }

    /* Topbar & Header Light Theme */
    html:not(.dark) .workspace-topbar {
      background: rgba(255, 255, 255, 0.96) !important;
      border-bottom: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .topbar-row-dinia {
      background: rgba(248, 250, 252, 0.9) !important;
      border-bottom: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .topbar-dinia-divider {
      background: #cbd5e1 !important;
    }

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

    html:not(.dark) .dinia-suite-tag {
      background: rgba(2, 132, 199, 0.08) !important;
      color: #0284c7 !important;
      border-color: rgba(2, 132, 199, 0.25) !important;
    }

    html:not(.dark) .workspace-row-left h2,
    html:not(.dark) #view-title {
      color: #0f172a !important;
      font-weight: 700 !important;
    }

    html:not(.dark) .workspace-title-block p,
    html:not(.dark) #view-subtitle {
      color: #475569 !important;
    }

    html:not(.dark) .mobile-menu-btn {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #334155 !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .search-input-wrap input {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #0f172a !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .search-input-wrap input:focus {
      background: #ffffff !important;
      border-color: #6366f1 !important;
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    }

    html:not(.dark) .search-input-wrap .search-icon {
      color: #64748b !important;
    }

    html:not(.dark) #company-selecto-trigger {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #0f172a !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) #company-selecto-trigger:hover,
    html:not(.dark) #company-selecto-trigger.active {
      background: #f8fafc !important;
      border-color: #94a3b8 !important;
      color: #0f172a !important;
    }

    html:not(.dark) #company-selecto-dropdown {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.12) !important;
    }

    html:not(.dark) .selecto-search-box {
      background: #f8fafc !important;
      border-bottom: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .selecto-search-inner {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
    }

    html:not(.dark) #company-selecto-search {
      color: #0f172a !important;
    }

    html:not(.dark) .selecto-option {
      color: #334155 !important;
    }

    html:not(.dark) .selecto-option:hover {
      background: #f1f5f9 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .selecto-option.selected {
      background: #eef2ff !important;
      color: #4338ca !important;
      font-weight: 600 !important;
    }

    /* Sidebar Light Theme */
    html:not(.dark) .sidebar {
      background: #ffffff !important;
      border-right: 1px solid #e2e8f0 !important;
    }

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

    html:not(.dark) .btn-sidebar-refresh {
      background: #f8fafc !important;
      border: 1px solid #cbd5e1 !important;
      color: #334155 !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .btn-sidebar-refresh:hover {
      background: #f1f5f9 !important;
      border-color: #94a3b8 !important;
      color: #0f172a !important;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    }

    html:not(.dark) .refresh-icon-box {
      background: rgba(99, 102, 241, 0.1) !important;
      color: #4f46e5 !important;
    }

    html:not(.dark) .refresh-hotkey {
      background: #e2e8f0 !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    html:not(.dark) .sidebar-section-title {
      color: #64748b !important;
      font-weight: 700 !important;
    }

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

    html:not(.dark) .nav-item:hover {
      background: #f1f5f9 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .nav-item.active {
      background: #eef2ff !important;
      border-color: #c7d2fe !important;
      color: #4338ca !important;
      font-weight: 700 !important;
    }

    html:not(.dark) .nav-item .nav-badge {
      background: #f1f5f9 !important;
      color: #64748b !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .nav-item.active .nav-badge {
      background: #e0e7ff !important;
      color: #4338ca !important;
      border-color: #c7d2fe !important;
    }

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

    html:not(.dark) .user-text-meta strong {
      color: #0f172a !important;
    }

    html:not(.dark) .user-text-meta span {
      color: #059669 !important;
    }

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

    html:not(.dark) .btn-logout:hover {
      background: #fee2e2 !important;
      color: #b91c1c !important;
      border-color: #f87171 !important;
    }

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

    html:not(.dark) .card-item:hover {
      border-color: #cbd5e1 !important;
      box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08) !important;
    }

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

    html:not(.dark) .card-avatar {
      background: #f1f5f9 !important;
      border-color: #e2e8f0 !important;
      color: #2563eb !important;
    }

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

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

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

    html:not(.dark) .badge-files-info {
      background: #f8fafc !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
    }

    html:not(.dark) .badge-files-info strong {
      color: #0f172a !important;
    }

    html:not(.dark) .card-meta-details {
      border-top: 1px solid #f1f5f9 !important;
      color: #64748b !important;
    }

    html:not(.dark) .btn-card-action {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #334155 !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .btn-card-action:hover {
      background: #f8fafc !important;
      border-color: #94a3b8 !important;
      color: #0f172a !important;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
    }

    html:not(.dark) .btn-card-action.test {
      background: #eef2ff !important;
      border-color: #c7d2fe !important;
      color: #4338ca !important;
    }

    html:not(.dark) .btn-card-action.mcp {
      background: #ecfeff !important;
      border-color: #a5f3fc !important;
      color: #0e7490 !important;
    }

    html:not(.dark) .btn-card-action.danger {
      background: #fef2f2 !important;
      border-color: #fecaca !important;
      color: #b91c1c !important;
    }

    html:not(.dark) .btn-card-action.danger:hover {
      background: #fee2e2 !important;
      border-color: #f87171 !important;
      color: #991b1b !important;
    }

    /* Users & IAM Light Theme */
    html:not(.dark) .dinia-users-sync-banner {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(16, 185, 129, 0.05)) !important;
      border: 1px solid #c7d2fe !important;
      box-shadow: 0 1px 3px rgba(99, 102, 241, 0.06) !important;
    }

    html:not(.dark) .dinia-sync-icon-box {
      background: rgba(99, 102, 241, 0.12) !important;
      border-color: rgba(99, 102, 241, 0.25) !important;
      color: #4f46e5 !important;
    }

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

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

    html:not(.dark) .dinia-sync-cta {
      background: #4f46e5 !important;
      border-color: #4338ca !important;
      color: #ffffff !important;
      box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25) !important;
    }

    html:not(.dark) .dinia-sync-cta:hover {
      background: #4338ca !important;
      color: #ffffff !important;
    }

    html:not(.dark) .user-filter-pill {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #475569 !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

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

    html:not(.dark) .user-filter-pill .pill-counter {
      background: #f1f5f9 !important;
      color: #475569 !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .user-filter-pill.pill-all.active {
      background: #4f46e5 !important;
      border-color: #4338ca !important;
      color: #ffffff !important;
      box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25) !important;
    }

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

    html:not(.dark) .user-filter-pill.pill-superadmin.active {
      background: #d97706 !important;
      border-color: #b45309 !important;
      color: #ffffff !important;
      box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25) !important;
    }

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

    html:not(.dark) .user-filter-pill.pill-admin.active {
      background: #0284c7 !important;
      border-color: #0369a1 !important;
      color: #ffffff !important;
      box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
    }

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

    html:not(.dark) .user-filter-pill.pill-user.active {
      background: #7c3aed !important;
      border-color: #6d28d9 !important;
      color: #ffffff !important;
      box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25) !important;
    }

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

    html:not(.dark) .user-filter-pill.pill-viewer.active {
      background: #059669 !important;
      border-color: #047857 !important;
      color: #ffffff !important;
      box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25) !important;
    }

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

    html:not(.dark) .users-search-box {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    html:not(.dark) .users-search-box input {
      color: #0f172a !important;
    }

    html:not(.dark) .users-search-box input::placeholder {
      color: #94a3b8 !important;
    }

    html:not(.dark) .users-search-box:focus-within {
      background: #ffffff !important;
      border-color: #6366f1 !important;
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    }

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

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

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

    html:not(.dark) .user-card-email {
      color: #64748b !important;
    }

    html:not(.dark) .badge-company-tag {
      background: #f1f5f9 !important;
      color: #334155 !important;
      border: 1px solid #cbd5e1 !important;
    }

    html:not(.dark) .badge-role-tag.admin {
      background: #e0f2fe !important;
      color: #0369a1 !important;
      border-color: #bae6fd !important;
    }

    html:not(.dark) .badge-role-tag.superadmin {
      background: #fef3c7 !important;
      color: #b45309 !important;
      border-color: #fde68a !important;
    }

    html:not(.dark) .badge-role-tag.viewer {
      background: #ecfdf5 !important;
      color: #047857 !important;
      border-color: #a7f3d0 !important;
    }

    html:not(.dark) .badge-dept-tag {
      background: #f5f3ff !important;
      color: #6d28d9 !important;
      border-color: #ddd6fe !important;
    }

    html:not(.dark) .badge-role-tag.badge-iam-tag {
      background: #eef2ff !important;
      color: #4338ca !important;
      border-color: #c7d2fe !important;
    }

    html:not(.dark) .badge-role-tag.badge-custom-perms {
      background: #fef3c7 !important;
      color: #b45309 !important;
      border-color: #fde68a !important;
    }

    html:not(.dark) .btn-card-action.btn-action-perms {
      color: #4338ca !important;
      border-color: #c7d2fe !important;
      background: #eef2ff !important;
    }

    html:not(.dark) .btn-card-action.btn-action-perms:hover {
      background: #e0e7ff !important;
      border-color: #a5b4fc !important;
      color: #3730a3 !important;
    }

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

    /* Modals & Forms */
    html:not(.dark) .modal-overlay {
      background: rgba(15, 23, 42, 0.45) !important;
      backdrop-filter: blur(8px) !important;
    }

    html:not(.dark) .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-dialog-sidebar {
      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-sidebar-header {
      background: #f8fafc !important;
      border-bottom: 1px solid #e2e8f0 !important;
    }

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

    html:not(.dark) .modal-nav-sidebar {
      background: #f8fafc !important;
      border-right: 1px solid #e2e8f0 !important;
    }

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

    html:not(.dark) .modal-nav-item:hover {
      background: #f1f5f9 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .modal-nav-item.active {
      background: #eef2ff !important;
      border-color: #c7d2fe !important;
      color: #4338ca !important;
    }

    html:not(.dark) .modal-nav-item .nav-step-num {
      background: #e2e8f0 !important;
      color: #475569 !important;
    }

    html:not(.dark) .modal-nav-item.active .nav-step-num {
      background: #4f46e5 !important;
      color: #ffffff !important;
    }

    html:not(.dark) .modal-nav-item .nav-step-subtitle {
      color: #64748b !important;
    }

    html:not(.dark) .modal-nav-item.active .nav-step-subtitle {
      color: #4338ca !important;
    }

    html:not(.dark) .modal-header {
      border-bottom-color: #e2e8f0 !important;
    }

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

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

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

    html:not(.dark) .form-group label {
      color: #334155 !important;
    }

    html:not(.dark) .form-control {
      background: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #0f172a !important;
    }

    html:not(.dark) .form-control:focus {
      border-color: #6366f1 !important;
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    }

    html:not(.dark) .user-perms-panel {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .user-perm-group-title {
      color: #475569 !important;
    }

    html:not(.dark) .user-perm-row {
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
    }

    html:not(.dark) .user-perm-row:hover {
      background: #f1f5f9 !important;
      border-color: #cbd5e1 !important;
    }

    html:not(.dark) .user-perm-name {
      color: #0f172a !important;
    }

    html:not(.dark) .user-perm-desc {
      color: #64748b !important;
    }

    html:not(.dark) .badge-perm-status.inherited {
      background: #f1f5f9 !important;
      color: #475569 !important;
      border: 1px solid #cbd5e1 !important;
    }

    /* RBAC & Tables */
    html:not(.dark) .rbac-table th {
      color: #475569 !important;
      border-bottom: 1px solid #e2e8f0 !important;
      background: #f8fafc !important;
    }

    html:not(.dark) .rbac-table td {
      border-bottom: 1px solid #f1f5f9 !important;
      color: #1e293b !important;
    }

    html:not(.dark) .rbac-table tr:hover td {
      background: #f8fafc !important;
    }

    html:not(.dark) .rbac-perm-label {
      color: #0f172a !important;
    }
