﻿/* ==========================================================
   APP.CSS — AudioFab Design System 2.0 (Cleaned Architecture)
   ========================================================== */

/* --- 1. IMPORTS DES TOKENS & FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('theme-variables.css');
@import url('01-af-tokens.css');

/* --- 2. REINITIALISATION BASE & VERROUILLAGE SANS OVERFLOW --- */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    background-color: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
    margin: 0;
    padding: 0;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* 1. Force la transparence des conteneurs MudBlazor */
.mud-layout,
.mud-main-content,
.audiofab-root-layout,
.audiofab-main-content {
    background-color: transparent !important;
    background: transparent !important;
    position: relative;
    z-index: 1; /* Place le contenu au-dessus du fond */
}

/* 2. Le conteneur du fond universel */
.app-universal-bg {
    position: fixed;
    inset: 0;
    z-index: 0 !important; /* Juste au-dessus du fond, sous les cartes */
    pointer-events: none !important;
    overflow: hidden;
}
/* 3. La grille numérique en filigrane */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--mud-palette-secondary, #262F73) 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 0.08;
}

.mud-dark .bg-grid {
    opacity: 0.04;
}
/* 4. Les orbes lumineux (Blobs Orange & Indigo) */
.blob-orange, .blob-indigo {
    position: absolute;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.22;
    pointer-events: none;
    animation: blobFloat 25s infinite alternate ease-in-out;
}

.blob-orange {
    background: var(--mud-palette-primary, #F2711C) !important;
    top: -12%;
    right: -6%;
}

.blob-indigo {
    background: var(--mud-palette-secondary, #262F73) !important;
    bottom: -12%;
    left: -6%;
    animation-delay: -10s;
}

/* Opacité en Mode Sombre */
.mud-dark .blob-orange {
    opacity: 0.16 !important;
}

.mud-dark .blob-indigo {
    opacity: 0.18 !important;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(35px, 35px) scale(1.08);
    }
}

.mud-main-content {
    flex: 1 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: calc(100vh - var(--mud-appbar-height)) !important;
    background-color: transparent !important;
}

/* --- 3. UTILITAIRES TYPOGRAPHIQUES & MICRO-INTERACTIONS --- */
.fw-900 { font-weight: 900 !important; }
.fw-800 { font-weight: 800 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-500 { font-weight: 500 !important; }

.fs-xxs { font-size: 0.68rem !important; }
.fs-xs { font-size: 0.76rem !important; }
.fs-sm { font-size: 0.85rem !important; }
.lh-1 { line-height: 1.15 !important; }
.italic { font-style: italic !important; }
.min-w-0 { min-width: 0 !important; }

.color-orange { color: var(--audiofab-orange) !important; }
.color-indigo { color: var(--audiofab-indigo) !important; }
.color-slate { color: var(--slate-500) !important; }
.color-error { color: var(--clinical-right) !important; }
.color-success { color: var(--audiofab-green) !important; }

.slate-300 { color: var(--slate-300) !important; }
.slate-400 { color: var(--slate-400) !important; }
.slate-500 { color: var(--slate-500) !important; }
.slate-600 { color: var(--slate-600) !important; }
.slate-700 { color: var(--slate-700) !important; }
.slate-800 { color: var(--slate-800) !important; }

.bg-primary-light {
    background-color: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.10) !important;
}

.border-primary {
    border-color: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.35) !important;
}

.bg-orange-dim {
    background-color: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.08) !important;
}

.bg-error-light {
    background-color: rgba(222, 29, 83, 0.08) !important;
}

.border-error {
    border: 1px solid rgba(222, 29, 83, 0.25) !important;
}

.border-top-subtle {
    border-top: 1px solid var(--glass-border) !important;
}

.border-bottom-dashed {
    border-bottom: 1px dashed var(--glass-border) !important;
}

.shadow-orange {
    box-shadow: 0 4px 12px rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.35) !important;
}

.transition-all {
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.hover-scale {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.hover-scale:hover {
    transform: scale(1.03);
}

.hover-subtle:hover {
    background-color: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.06) !important;
}

.uppercase-tracking {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.font-mono, .mono-font {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
    font-size: 0.8rem;
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom Scrollbar fine et élégante */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(242, 113, 28, 0.55);
}

/* --- 4. OVERRIDES CHAMP INPUTS & SELECTS MUDBLAZOR --- */
.bg-input-glass .mud-input-outlined,
.mud-input-outlined.bg-input-glass,
.bg-input-glass {
    border-radius: var(--af-radius-md) !important;
    background: var(--glass-bg-subtle, rgba(255, 255, 255, 0.85)) !important;
    transition: all 0.2s ease !important;
}

html.mud-dark .bg-input-glass .mud-input-outlined,
html.mud-dark .mud-input-outlined.bg-input-glass,
html.mud-dark .bg-input-glass,
.mud-dark .bg-input-glass .mud-input-outlined,
.mud-dark .mud-input-outlined.bg-input-glass,
.mud-dark .bg-input-glass,
.mud-theme-dark .bg-input-glass .mud-input-outlined,
.mud-theme-dark .mud-input-outlined.bg-input-glass {
    background: rgba(15, 23, 42, 0.75) !important;
    color: var(--mud-palette-text-primary, #F1F5F9) !important;
}

.bg-input-glass .mud-input-outlined fieldset,
.mud-input-outlined.bg-input-glass fieldset {
    border: 1.5px solid var(--glass-border) !important;
    border-radius: var(--af-radius-md) !important;
}

.bg-input-glass:focus-within .mud-input-outlined fieldset,
.mud-input-outlined.bg-input-glass:focus-within fieldset {
    border-color: var(--audiofab-orange) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.12) !important;
}

/* Fix du label MudBlazor lors du focus */
.mud-input-label-outlined.mud-input-label-outlined-shrink {
    background-color: var(--mud-palette-surface) !important;
    padding: 0 6px !important;
    margin-left: -2px;
    transform: translate(14px, -6px) scale(0.75) !important;
    z-index: 5 !important;
}

/* --- 5. OVERRIDES MODALES & DIALOGUES (MUDBLAZOR & CUSTOM) --- */

/* 1. Backdrop universel des modales */
.mud-overlay.mud-overlay-dialog {
    background-color: rgba(11, 14, 20, 0.65) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.mud-dialog-container {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 2. Modales standards et crystal */
.mud-dialog,
.custom-dialog-glass,
.crystal-card.mud-dialog {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 65px -12px rgba(0, 0, 0, 0.45) !important;
    overflow: hidden !important;
}

html.mud-dark .mud-dialog,
.mud-dark .mud-dialog,
.mud-theme-dark .mud-dialog,
html.mud-dark .custom-dialog-glass,
.mud-dark .custom-dialog-glass,
html.mud-dark .crystal-card,
.mud-dark .crystal-card {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8) !important;
}

.mud-dialog .mud-dialog-title {
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding: 18px 24px 14px !important;
    font-weight: 800 !important;
}

html.mud-dark .mud-dialog .mud-dialog-title,
.mud-dark .mud-dialog .mud-dialog-title,
.mud-theme-dark .mud-dialog .mud-dialog-title {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.mud-dialog .mud-dialog-content {
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    padding: 20px 24px !important;
}

html.mud-dark .mud-dialog .mud-dialog-content,
.mud-dark .mud-dialog .mud-dialog-content,
.mud-theme-dark .mud-dialog .mud-dialog-content {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
}

.mud-dialog .mud-dialog-actions {
    background: var(--mud-palette-surface) !important;
    border-top: 1px solid var(--glass-border) !important;
    padding: 14px 24px 18px !important;
    gap: 8px !important;
}

html.mud-dark .mud-dialog .mud-dialog-actions,
.mud-dark .mud-dialog .mud-dialog-actions,
.mud-theme-dark .mud-dialog .mud-dialog-actions {
    background-color: #0F172A !important;
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

/* 3. Edge-to-Edge Dialog (GenericDialogLayout pour les fiches d'empreintes) */
.edge-to-edge-dialog {
    display: flex !important;
    flex-direction: column !important;
    height: 92vh !important;
    max-height: 92vh !important;
    min-height: 92vh !important;
    margin: auto !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    background: var(--mud-palette-surface) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 35px 85px -15px rgba(0, 0, 0, 0.6) !important;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.edge-to-edge-dialog.summary-closed,
.edge-to-edge-dialog:has(.is-summary-closed) {
    width: min(1080px, 95vw) !important;
    max-width: min(1080px, 95vw) !important;
}

.edge-to-edge-dialog.summary-open,
.edge-to-edge-dialog:has(.is-summary-open) {
    width: min(1560px, 96vw) !important;
    max-width: min(1560px, 96vw) !important;
}

.edge-to-edge-dialog .mud-dialog-content {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
    background: var(--mud-palette-surface) !important;
}

.dialog-flex-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    overflow: hidden;
    background: var(--mud-palette-surface) !important;
}

.dialog-header {
    flex-shrink: 0;
    background: var(--mud-palette-surface) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding: 14px 28px !important;
}

.dialog-form-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.dialog-scroll-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    background: var(--slate-50) !important;
}

html.mud-dark .dialog-scroll-body,
.mud-dark .dialog-scroll-body {
    background: rgba(11, 14, 20, 0.60) !important;
}

.dialog-footer {
    flex-shrink: 0;
    background: var(--mud-palette-surface) !important;
    border-top: 1px solid var(--glass-border) !important;
    padding: 14px 28px !important;
}

.dialog-grid-container {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.main-form-column {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 28px !important;
}

.summary-side-column {
    width: 440px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 28px !important;
    background: var(--glass-bg-subtle, rgba(248, 250, 252, 0.7)) !important;
    border-left: 1px solid var(--glass-border) !important;
    transition: width 0.3s ease;
}

html.mud-dark .summary-side-column,
.mud-dark .summary-side-column {
    background: rgba(15, 23, 42, 0.75) !important;
    border-left-color: rgba(255, 255, 255, 0.08) !important;
}

.bg-summary-aside {
    background: var(--glass-bg-subtle, rgba(248, 250, 252, 0.7)) !important;
}

html.mud-dark .bg-summary-aside,
.mud-dark .bg-summary-aside {
    background: rgba(15, 23, 42, 0.75) !important;
}

.collab-lock-banner {
    background: #DC2626;
    color: #FFFFFF;
    font-weight: 800;
}

.close-btn-minimal {
    border-radius: 50% !important;
    transition: background 0.2s ease !important;
}

.close-btn-minimal:hover {
    background: rgba(242, 113, 28, 0.12) !important;
    color: var(--mud-palette-primary) !important;
}

@media (max-width: 960px) {
    .edge-to-edge-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
    }

    .dialog-grid-container {
        flex-direction: column;
    }

    .summary-side-column {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--glass-border);
    }
}

/* --- 6. OVERRIDES TABLES MUDBLAZOR --- */
.audiofab-table-container {
    background: var(--mud-palette-surface) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--af-radius-lg) !important;
    overflow: hidden !important;
}

    .audiofab-table-container .mud-table-head {
        background: var(--slate-50) !important;
        border-bottom: 1px solid var(--glass-border) !important;
    }

    .audiofab-table-container .mud-th {
        font-size: 0.68rem !important;
        font-weight: 900 !important;
        letter-spacing: 0.08em !important;
        color: var(--slate-500) !important;
        text-transform: uppercase !important;
        padding: 14px 16px !important;
    }

    .audiofab-table-container .mud-td {
        font-size: 0.85rem !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid var(--glass-border) !important;
    }

/* --- 7. ARRIÈRE-PLAN FOND UNIVERSEL --- */
.app-universal-bg {
    position: fixed;
    inset: 0;
    z-index: var(--z-background);
    pointer-events: none;
    overflow: hidden;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--audiofab-indigo) 0.8px, transparent 0.8px);
    background-size: 40px 40px;
    opacity: 0.06;
}

.blob-orange, .blob-indigo {
    position: absolute;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.16;
    animation: blobFloat 28s infinite alternate ease-in-out;
}

.blob-orange {
    background: var(--audiofab-orange);
    top: -15%;
    right: -8%;
}

.blob-indigo {
    background: var(--audiofab-indigo);
    bottom: -15%;
    left: -8%;
    animation-delay: -10s;
}

@keyframes blobFloat {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(40px, 40px) scale(1.06);
    }
}
/* ==========================================================
   SIDEBAR COMPACTE & MODE REPLIÉ (72px) PERFECT ALIGNMENT
   ========================================================== */

/* Masquage de l'overflow horizontal pour éviter les barres de défilement */
.audiofab-sidebar, .audiofab-nav-menu {
    overflow-x: hidden !important;
}

    /* --- MODE DÉPLIÉ (Menu ouvert 260px) --- */
    .audiofab-nav-menu .mud-nav-link.is-open {
        justify-content: flex-start !important;
        padding: 8px 12px !important;
    }

        .audiofab-nav-menu .mud-nav-link.is-open .mud-nav-link-icon {
            margin-right: 12px !important;
            margin-left: 0 !important;
        }

        .audiofab-nav-menu .mud-nav-link.is-open.active {
            border-left: 3.5px solid var(--mud-palette-primary) !important;
            background-color: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
            color: var(--mud-palette-primary) !important;
        }

    /* --- MODE REPLIÉ (Menu fermé 72px) --- */
    .audiofab-nav-menu .mud-nav-link.is-collapsed {
        justify-content: center !important;
        padding: 8px 0 !important;
        margin: 3px 6px !important;
        text-align: center !important;
        border-left: none !important;
    }

        .audiofab-nav-menu .mud-nav-link.is-collapsed .mud-nav-link-icon {
            margin-right: 0 !important;
            margin-left: 0 !important;
            font-size: 1.35rem !important; /* Icône légèrement agrandie pour le mode compact */
        }

        /* Élément actif en mode plié (Halo néon centré sans bordure) */
        .audiofab-nav-menu .mud-nav-link.is-collapsed.active {
            border-left: none !important;
            background-color: rgba(var(--mud-palette-primary-rgb), 0.16) !important;
            box-shadow: 0 0 12px rgba(var(--mud-palette-primary-rgb), 0.25) !important;
            border-radius: 12px !important;
        }

            .audiofab-nav-menu .mud-nav-link.is-collapsed.active .mud-nav-link-icon {
                color: var(--mud-palette-primary) !important;
            }

/* ==========================================================
   AUDIOFAB DESIGN SYSTEM — EFFET "WAHOU" HAUTE DENSITÉ
   ========================================================== */

/* --- 1. SIDEBAR VERRE POLAIRE DE NIVEAU SAAS --- */
.audiofab-sidebar {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--glass-bg, rgba(255, 255, 255, 0.85)) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-right: 1px solid var(--glass-border) !important;
    box-shadow: 4px 0 25px rgba(15, 23, 42, 0.03) !important;
}

html.mud-dark .audiofab-sidebar,
.mud-dark .audiofab-sidebar,
.mud-theme-dark .audiofab-sidebar {
    background: rgba(15, 23, 42, 0.90) !important;
    border-right-color: rgba(255, 255, 255, 0.08) !important;
}

/* --- 2. TITRES DE SECTION AVEC PUCES LUMINEUSES --- */
.nav-section-container {
    margin-top: 14px !important;
    margin-bottom: 4px !important;
}

.nav-section-label {
    padding: 8px 14px 4px 14px !important;
    font-size: 0.60rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.14em !important;
    color: var(--slate-400) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.nav-section-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-orange {
    background: #F2711C;
    box-shadow: 0 0 8px rgba(242, 113, 28, 0.6);
}

.dot-teal {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.dot-indigo {
    background: #1A73E8;
    box-shadow: 0 0 8px rgba(26, 115, 232, 0.6);
}

.dot-purple {
    background: #8B5CF6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}

/* --- 3. LIENS DE NAVIGATION (EFFET NÉON & GLIDE) --- */
.audiofab-nav-menu .mud-nav-link {
    min-height: 40px !important;
    padding: 8px 14px !important;
    border-radius: 12px !important;
    margin-bottom: 3px !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    color: var(--slate-700) !important;
    font-size: 0.83rem !important;
    font-weight: 600 !important;
    background: transparent !important;
    border-left: 3.5px solid transparent !important;
}

html.mud-dark .audiofab-nav-menu .mud-nav-link,
.mud-dark .audiofab-nav-menu .mud-nav-link,
.mud-theme-dark .audiofab-nav-menu .mud-nav-link {
    color: #CBD5E1 !important;
}

/* Survol (Hover Glide) */
.audiofab-nav-menu .mud-nav-link:hover:not(.active) {
    background: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
    color: var(--mud-palette-primary) !important;
    transform: translateX(4px) !important;
}

    .audiofab-nav-menu .mud-nav-link:hover:not(.active) .mud-nav-link-icon {
        color: var(--mud-palette-primary) !important;
    }

/* 🚀 ÉLÉMENT SELECTIONNÉ ACTIF (EFFET WAHOU) */
.audiofab-nav-menu .mud-nav-link.active {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, rgba(var(--mud-palette-primary-rgb), 0.05) 100%) !important;
    color: var(--mud-palette-primary) !important;
    font-weight: 800 !important;
    border-left: 4px solid var(--mud-palette-primary) !important;
    box-shadow: 0 4px 15px rgba(var(--mud-palette-primary-rgb), 0.20) !important;
}

    .audiofab-nav-menu .mud-nav-link.active .mud-nav-link-icon {
        color: var(--mud-palette-primary) !important;
        filter: drop-shadow(0 2px 6px rgba(var(--mud-palette-primary-rgb), 0.4));
    }

/* --- 4. TOPBAR EN VERRE DÉCOUPÉ & CAPSULES --- */
.mud-appbar-full-width {
    background: var(--glass-bg, rgba(255, 255, 255, 0.85)) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

html.mud-dark .mud-appbar-full-width,
.mud-dark .mud-appbar-full-width,
.mud-theme-dark .mud-appbar-full-width {
    background: rgba(15, 23, 42, 0.90) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* --- 5. BOUTON NEON D'ACTION PRINCIPALE --- */
.btn-audiofab-neon {
    background-color: var(--mud-palette-primary) !important;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(0, 0, 0, 0.12) 100%) !important;
    color: var(--mud-palette-primary-text, #FFFFFF) !important;
    font-weight: 800 !important;
    border-radius: 50px !important;
    letter-spacing: 0.04em !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(var(--mud-palette-primary-rgb), 0.35) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
    .btn-audiofab-neon:hover:not(:disabled) {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 8px 24px rgba(var(--mud-palette-primary-rgb), 0.50) !important;
        background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(0, 0, 0, 0.08) 100%) !important;
    }

    .btn-audiofab-neon:disabled {
        opacity: 0.55 !important;
        box-shadow: none !important;
        transform: none !important;
    }

/* --- 6. CARTES DE STATISTIQUES & VERRE --- */
.dashboard-glass-card, .catalog-glass-card, .af-stat-card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.85)) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    box-shadow: var(--af-shadow-sm) !important;
    color: var(--mud-palette-text-primary) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html.mud-dark .dashboard-glass-card,
html.mud-dark .catalog-glass-card,
html.mud-dark .af-stat-card,
.mud-dark .dashboard-glass-card,
.mud-dark .catalog-glass-card,
.mud-dark .af-stat-card,
.mud-theme-dark .dashboard-glass-card,
.mud-theme-dark .catalog-glass-card,
.mud-theme-dark .af-stat-card {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #F1F5F9 !important;
}

.dashboard-glass-card:hover,
.catalog-glass-card:hover,
.af-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--mud-palette-primary-rgb), 0.35) !important;
    box-shadow: 0 16px 35px -10px rgba(var(--mud-palette-primary-rgb), 0.18) !important;
}

/* ==========================================================
   CONVERSION AUTOMATIQUE DES CLASSES RAZOR EN MODE SOMBRE
   ========================================================== */

/* 1. Mappage de .bg-white pour s'adapter au thème (JAMAIS BLANC EN MODE SOMBRE) */
.bg-white {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

html.mud-dark .bg-white,
body.mud-dark .bg-white,
.mud-dark .bg-white,
.mud-theme-dark .bg-white,
.mud-dark-theme .bg-white {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.bg-slate-50 {
    background-color: var(--slate-50) !important;
}

html.mud-dark .bg-slate-50,
body.mud-dark .bg-slate-50,
.mud-dark .bg-slate-50,
.mud-theme-dark .bg-slate-50 {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.bg-slate-100 {
    background-color: var(--slate-100) !important;
}

html.mud-dark .bg-slate-100,
body.mud-dark .bg-slate-100,
.mud-dark .bg-slate-100,
.mud-theme-dark .bg-slate-100 {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

/* 2. Surcharge des textes indigos sombres en couleur indigo lumineuse de contraste */
html.mud-dark .color-indigo,
body.mud-dark .color-indigo,
.mud-dark .color-indigo,
.mud-theme-dark .color-indigo {
    color: var(--audiofab-indigo, #818CF8) !important;
}

/* 2bis. Boutons verre interactifs */
.btn-audiofab-glass {
    background: var(--glass-bg, rgba(255, 255, 255, 0.85)) !important;
    border: 1.5px solid var(--glass-border) !important;
    color: var(--mud-palette-primary, #F2711C) !important;
    font-weight: 700 !important;
    border-radius: var(--af-radius-md, 12px) !important;
    backdrop-filter: blur(12px) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-audiofab-glass:hover:not(:disabled) {
    background: var(--mud-palette-surface) !important;
    border-color: var(--mud-palette-primary, #F2711C) !important;
    color: var(--mud-palette-primary, #F2711C) !important;
    box-shadow: 0 4px 14px rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.20) !important;
    transform: translateY(-1px);
}

/* 3. Conversion des cartes, tables et conteneurs MudBlazor */
.mud-paper {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

html.mud-dark .mud-paper,
body.mud-dark .mud-paper,
.mud-dark .mud-paper,
.mud-theme-dark .mud-paper,
html.mud-dark .mud-card,
body.mud-dark .mud-card,
.mud-dark .mud-card,
.mud-theme-dark .mud-card {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.mud-table, .mud-table-container, .audiofab-table-container {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

html.mud-dark .mud-table,
body.mud-dark .mud-table,
.mud-dark .mud-table,
.mud-theme-dark .mud-table,
html.mud-dark .mud-table-container,
body.mud-dark .mud-table-container,
.mud-dark .mud-table-container,
.mud-theme-dark .mud-table-container {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
}

html.mud-dark .mud-table-head,
body.mud-dark .mud-table-head,
.mud-dark .mud-table-head,
.mud-theme-dark .mud-table-head {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

/* 4. Surcharge des inputs et sélecteurs */
html.mud-dark input,
body.mud-dark input,
.mud-dark input,
.mud-theme-dark input,
html.mud-dark .mud-select-input,
body.mud-dark .mud-select-input,
.mud-dark .mud-select-input,
.mud-theme-dark .mud-select-input,
html.mud-dark .mud-input-root,
.mud-dark .mud-input-root,
.mud-theme-dark .mud-input-root {
    color: #F1F5F9 !important;
}

html.mud-dark .mud-input-label,
.mud-dark .mud-input-label,
.mud-theme-dark .mud-input-label {
    color: #94A3B8 !important;
}

/* Bannière de recommandation adaptée à la couleur secondaire du client */
.recommended-header-banner {
    background: linear-gradient(135deg, var(--mud-palette-primary) 0%, var(--mud-palette-secondary) 100%) !important;
    color: #FFFFFF !important;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(var(--mud-palette-primary-rgb), 0.25) !important;
}

/* ==========================================================
   MISE EN PAGE PORTAIL D'AUTHENTIFICATION (LOGIN / REGISTER)
   ========================================================== */

.login-auth-wrapper {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 100 !important;
    padding: 24px 16px !important;
    box-sizing: border-box !important;
}

.login-card-center-box {
    width: 100% !important;
    max-width: 780px !important;
    margin: auto !important;
    position: relative !important;
    z-index: 110 !important;
}

.login-theme-toggle {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 120;
    background: var(--glass-bg, rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border, rgba(38, 47, 115, 0.10));
    border-radius: 9999px;
    padding: 2px;
    box-shadow: var(--af-shadow-sm);
    color: var(--af-brand-indigo, #262F73);
}

html.mud-dark .login-theme-toggle,
body.mud-dark .login-theme-toggle {
    color: #F8FAFC;
}

.login-footer-link {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    color: var(--slate-500, #64748B) !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.login-footer-link:hover {
    color: var(--af-brand-orange, #F2711C) !important;
    text-decoration: underline !important;
}

/* ==========================================================
   TOPBAR CAPSULES, POPOVERS & RECHERCHE GLOBALE
   ========================================================== */

.establishment-selector-wrapper {
    background: var(--glass-bg, rgba(255, 255, 255, 0.72)) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    min-height: 40px;
}

.establishment-selector-wrapper:hover,
.establishment-selector-wrapper.is-open {
    border-color: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.45) !important;
    box-shadow: 0 6px 18px rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.16) !important;
    transform: translateY(-1px);
}

.establishment-selector-wrapper.is-consolidated {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(255, 255, 255, 0.85) 100%) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

html.mud-dark .establishment-selector-wrapper,
.mud-dark .establishment-selector-wrapper {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

html.mud-dark .establishment-selector-wrapper.is-consolidated,
.mud-dark .establishment-selector-wrapper.is-consolidated {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(15, 23, 42, 0.90) 100%) !important;
    border-color: rgba(245, 158, 11, 0.40) !important;
}

.establishment-label-text {
    font-size: 0.80rem !important;
    max-width: 165px;
}

@media (max-width: 599.98px) {
    .establishment-label-text {
        font-size: 0.74rem !important;
        max-width: 105px;
    }
}

.establishment-popover-clean,
.user-menu-popover,
.search-results-popover {
    background: var(--mud-palette-surface, rgba(255, 255, 255, 0.96)) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
}

html.mud-dark .establishment-popover-clean,
.mud-dark .establishment-popover-clean,
html.mud-dark .user-menu-popover,
.mud-dark .user-menu-popover,
html.mud-dark .search-results-popover,
.mud-dark .search-results-popover {
    background: rgba(15, 23, 42, 0.96) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 24px 55px -10px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
}

.establishment-item {
    transition: all 0.18s ease !important;
}

.establishment-item-active {
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.10) !important;
    border: 1px solid rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.25) !important;
}

.active-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--mud-palette-primary);
}

.user-avatar-btn {
    border: 1px solid transparent;
}

.user-avatar-btn:hover {
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.08);
    border-color: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.20);
}

.user-menu-header {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.08) 0%, rgba(var(--mud-palette-secondary-rgb, 38, 47, 115), 0.05) 100%);
    border: 1px solid var(--glass-border);
}

html.mud-dark .user-menu-header,
.mud-dark .user-menu-header {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.14) 0%, rgba(30, 41, 59, 0.65) 100%);
}

/* Barre de recherche globale vitrée */
.global-search-wrapper {
    width: clamp(190px, 22vw, 310px);
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-search-wrapper:focus-within {
    width: clamp(220px, 26vw, 360px);
}

.search-bar-glass {
    background: var(--glass-bg-subtle, rgba(248, 250, 252, 0.85)) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 9999px !important;
    transition: all 0.22s ease !important;
}

.search-bar-glass:focus-within {
    background: var(--mud-palette-surface, #FFFFFF) !important;
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.14) !important;
}

html.mud-dark .search-bar-glass,
.mud-dark .search-bar-glass {
    background: rgba(15, 23, 42, 0.82) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

html.mud-dark .search-bar-glass:focus-within,
.mud-dark .search-bar-glass:focus-within {
    background: rgba(15, 23, 42, 0.98) !important;
    border-color: var(--mud-palette-primary) !important;
}

html.mud-dark .search-bar-glass,
.mud-dark .search-bar-glass {
    background: rgba(15, 23, 42, 0.82) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

html.mud-dark .search-bar-glass:focus-within,
.mud-dark .search-bar-glass:focus-within {
    background: rgba(15, 23, 42, 0.98) !important;
    border-color: var(--mud-palette-primary) !important;
}

.result-item-hover:hover {
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.08) !important;
}

.result-icon-container {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.10);
    flex-shrink: 0;
}

.type-badge {
    font-size: 0.60rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.type-badge.patient {
    background: rgba(26, 115, 232, 0.12);
    color: #1A73E8;
}

.type-badge.imprint {
    background: rgba(242, 113, 28, 0.14);
    color: #F2711C;
}

/* ==========================================================
   BANNIÈRE HDS : MODE INFILTRATION SUPERADMIN
   ========================================================== */
.hds-impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 42px;
    z-index: 2000;
    background: linear-gradient(90deg, #991b1b 0%, #dc2626 40%, #ea580c 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    box-shadow: 0 3px 12px rgba(185, 28, 28, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.badge-impersonation-tag {
    background: rgba(0, 0, 0, 0.4);
    color: #fef08a;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-right: 8px;
    border: 1px solid rgba(254, 240, 138, 0.35);
}

.btn-exit-impersonation {
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    transition: all 0.2s ease-in-out;
}

.btn-exit-impersonation:hover {
    background-color: #000000 !important;
    transform: scale(1.02);
}

/* Décalage automatique du layout et de la TopBar quand le mode infiltration est actif */
.has-impersonation-banner .mud-appbar {
    top: 42px !important;
}

.has-impersonation-banner .mud-main-content {
    padding-top: calc(var(--mud-appbar-height) + 42px) !important;
}

.has-impersonation-banner .mud-drawer-fixed {
    top: calc(var(--mud-appbar-height) + 42px) !important;
    height: calc(100vh - var(--mud-appbar-height) - 42px) !important;
}

.environment-dot-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: pointer;
}

.environment-dot-indicator.is-preprod {
    background: #F59E0B;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.65);
}

.environment-dot-indicator.is-dev {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
}

/* ==========================================================
   COMPOSANTS MÉTIER : STEPPER D'EMPREINTE & CARTES CLINIQUES
   ========================================================== */

.stepper-horizontal-container {
    position: relative;
    padding: 8px 16px;
}

.stepper-track-line {
    position: absolute;
    top: 26px;
    left: 12%;
    right: 12%;
    height: 3px;
    background: var(--slate-200);
    z-index: 0;
    border-radius: 999px;
}

.stepper-steps-row {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.step-node-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 72px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-node-item:hover {
    transform: translateY(-2px);
}

.step-circle-outer {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mud-palette-surface);
    border: 2px solid var(--slate-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--af-shadow-sm);
}

.step-circle-inner {
    font-size: 0.80rem;
    font-weight: 900;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-node-label {
    font-size: 0.70rem;
    font-weight: 700;
    color: var(--slate-500);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.step-node-item.is-active .step-circle-outer,
.step-node-item.is-selected .step-circle-outer {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-primary);
    box-shadow: 0 0 0 5px rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.18);
    transform: scale(1.08);
}

.step-node-item.is-active .step-circle-inner,
.step-node-item.is-selected .step-circle-inner {
    color: #FFFFFF;
}

.step-node-item.is-active .step-node-label,
.step-node-item.is-selected .step-node-label {
    color: var(--mud-palette-primary);
    font-weight: 900;
}

.step-node-item.is-completed .step-circle-outer {
    border-color: var(--audiofab-green, #10B981);
    background: rgba(16, 185, 129, 0.12);
}

.step-node-item.is-completed .step-circle-inner,
.step-node-item.is-completed .step-node-label {
    color: var(--audiofab-green, #10B981);
}

/* --- TABS MODERNES HAUT DE GAMME (ImprintForm) --- */
.custom-modern-tabs .mud-tabs-tabbar {
    background: transparent !important;
    border-bottom: 2px solid var(--glass-border) !important;
    padding: 0 8px;
}

.custom-modern-tabs .mud-tab {
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    text-transform: none !important;
    letter-spacing: 0.02em !important;
    padding: 12px 20px !important;
    border-radius: 12px 12px 0 0 !important;
    transition: all 0.2s ease !important;
    color: var(--slate-500) !important;
}

.custom-modern-tabs .mud-tab.mud-tab-active {
    color: var(--mud-palette-primary, #F2711C) !important;
}

.custom-modern-tabs .mud-tab:hover {
    color: var(--mud-palette-primary, #F2711C) !important;
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.06) !important;
}

.custom-modern-tabs .mud-tabs-panels {
    background: var(--mud-palette-surface) !important;
    border-radius: 0 0 20px 20px !important;
    border: 1px solid var(--glass-border) !important;
    border-top: none !important;
}

/* --- SÉLECTEUR ANATOMIQUE D'OREILLE (EarInteractiveMap) --- */
.ear-interactive-container {
    user-select: none;
}

.ear-map-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 22px;
    border-radius: 20px;
    background: var(--mud-palette-surface);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    min-width: 140px;
    box-shadow: var(--af-shadow-sm);
}

.ear-map-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--af-shadow-md);
}

.ear-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: monospace;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-600);
}

.ear-svg-wrapper {
    width: 60px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ear-svg-wrapper.flipped {
    transform: scaleX(-1);
}

.ear-svg {
    width: 100%;
    height: 100%;
}

.ear-path-body {
    fill: none;
    stroke: var(--slate-400);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.25s ease;
}

.ear-path-canal {
    fill: none;
    stroke: var(--slate-300);
    stroke-width: 4;
    stroke-linecap: round;
    transition: all 0.25s ease;
}

.ear-card-label {
    font-size: 0.75rem;
    font-weight: 800;
    margin-top: 10px;
    letter-spacing: 0.04em;
    color: var(--slate-600);
}

/* OG Actif : Bleu Clinique #1A73E8 */
.ear-map-card.left-ear-card:hover,
.ear-map-card.is-active-left,
.ear-map-card.left-ear-card.is-active-both {
    border-color: var(--clinical-left, #1A73E8) !important;
    background: var(--clinical-left-bg, rgba(26, 115, 232, 0.08)) !important;
    box-shadow: 0 8px 24px rgba(26, 115, 232, 0.22) !important;
}

.ear-map-card.is-active-left .ear-path-body,
.ear-map-card.left-ear-card.is-active-both .ear-path-body {
    stroke: var(--clinical-left, #1A73E8) !important;
    fill: rgba(26, 115, 232, 0.15) !important;
}

.ear-map-card.is-active-left .ear-path-canal,
.ear-map-card.left-ear-card.is-active-both .ear-path-canal {
    stroke: var(--clinical-left, #1A73E8) !important;
}

.ear-map-card.is-active-left .ear-card-badge,
.ear-map-card.left-ear-card.is-active-both .ear-card-badge {
    background: var(--clinical-left, #1A73E8) !important;
    color: #FFFFFF !important;
}

.ear-map-card.is-active-left .ear-card-label,
.ear-map-card.left-ear-card.is-active-both .ear-card-label {
    color: var(--clinical-left, #1A73E8) !important;
}

/* OD Actif : Rouge Clinique #DE1D53 */
.ear-map-card.right-ear-card:hover,
.ear-map-card.is-active-right,
.ear-map-card.right-ear-card.is-active-both {
    border-color: var(--clinical-right, #DE1D53) !important;
    background: var(--clinical-right-bg, rgba(222, 29, 83, 0.08)) !important;
    box-shadow: 0 8px 24px rgba(222, 29, 83, 0.22) !important;
}

.ear-map-card.is-active-right .ear-path-body,
.ear-map-card.right-ear-card.is-active-both .ear-path-body {
    stroke: var(--clinical-right, #DE1D53) !important;
    fill: rgba(222, 29, 83, 0.15) !important;
}

.ear-map-card.is-active-right .ear-path-canal,
.ear-map-card.right-ear-card.is-active-both .ear-path-canal {
    stroke: var(--clinical-right, #DE1D53) !important;
}

.ear-map-card.is-active-right .ear-card-badge,
.ear-map-card.right-ear-card.is-active-both .ear-card-badge {
    background: var(--clinical-right, #DE1D53) !important;
    color: #FFFFFF !important;
}

.ear-map-card.is-active-right .ear-card-label,
.ear-map-card.right-ear-card.is-active-both .ear-card-label {
    color: var(--clinical-right, #DE1D53) !important;
}

/* Binaural Actif */
.ear-map-card.both-ear-card .both-icon-wrapper {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-400);
    transition: all 0.25s ease;
}

.ear-map-card.both-ear-card:hover,
.ear-map-card.is-active-both-btn {
    border-color: var(--mud-palette-primary, #F2711C) !important;
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.08) !important;
    box-shadow: 0 8px 24px rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.22) !important;
}

.ear-map-card.is-active-both-btn .both-icon-wrapper {
    color: var(--mud-palette-primary, #F2711C) !important;
    transform: scale(1.15);
}

.ear-map-card.is-active-both-btn .ear-card-label {
    color: var(--mud-palette-primary, #F2711C) !important;
}

/* Cartes Oreilles OD / OG (ImprintForm, ImprintSummary, ProductionManager) */
.ear-card-pro {
    background: var(--mud-palette-surface);
    border-radius: 18px;
    border: 1.5px solid var(--glass-border);
    box-shadow: var(--af-shadow-sm);
    transition: all 0.25s ease;
}

.ear-card-pro.right-ear {
    border-top: 4px solid var(--clinical-right, #DE1D53);
}

.ear-card-pro.left-ear {
    border-top: 4px solid var(--clinical-left, #1A73E8);
}

.ear-card-pro.ear-card-linked {
    box-shadow: 0 8px 26px rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.12);
}

.right-ear-spec,
.right-ear-spec-mini {
    background: var(--clinical-right-bg, #FFF5F6);
    border: 1px solid var(--clinical-right-border, rgba(222, 29, 83, 0.22));
    border-left: 4px solid var(--clinical-right, #DE1D53);
}

.left-ear-spec,
.left-ear-spec-mini {
    background: var(--clinical-left-bg, #F0F6FF);
    border: 1px solid var(--clinical-left-border, rgba(26, 115, 232, 0.22));
    border-left: 4px solid var(--clinical-left, #1A73E8);
}

.clinical-title-right {
    color: var(--clinical-right, #DE1D53) !important;
    font-size: 0.78rem;
}

.clinical-title-left {
    color: var(--clinical-left, #1A73E8) !important;
    font-size: 0.78rem;
}

.bg-technical-ticket {
    background: var(--slate-50);
    border: 1px solid var(--glass-border);
}

.summary-card-wahou {
    background: var(--mud-palette-surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--af-shadow-sm);
    position: relative;
}

.card-top-accent {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--mud-palette-primary) 0%, var(--mud-palette-secondary) 100%);
}

/* ==========================================================
   RESPONSIVE GLOBAL (MOBILE / TABLETTE / DESKTOP)
   ========================================================== */

@media (max-width: 959.98px) {
    .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .audiofab-icon-box {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 12px;
    }
}

@media (max-width: 599.98px) {
    .audiofab-table-container {
        overflow-x: auto !important;
    }

    .stepper-track-line {
        left: 8%;
        right: 8%;
    }

    .step-node-label {
        font-size: 0.62rem;
    }
}

/* ==========================================================
   PAGE LOGIN — OVERRIDES MODE SOMBRE SÉCURISÉS (GLOBAL)
   ========================================================== */
html.mud-dark .login-cockpit-card,
body.mud-dark .login-cockpit-card,
.mud-dark .login-cockpit-card {
    background: rgba(15, 23, 42, 0.94) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 28px 65px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

html.mud-dark .login-logo-badge,
body.mud-dark .login-logo-badge,
.mud-dark .login-logo-badge {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.90) 0%, rgba(15, 23, 42, 0.90) 100%) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.50), 0 0 24px rgba(242, 113, 28, 0.15) !important;
}

html.mud-dark .login-main-title,
body.mud-dark .login-main-title,
.mud-dark .login-main-title {
    color: #F1F5F9 !important;
}

html.mud-dark .login-field-label,
body.mud-dark .login-field-label,
.mud-dark .login-field-label {
    color: #CBD5E1 !important;
}

html.mud-dark .login-cockpit-card .pro-input-field .mud-input-outlined,
body.mud-dark .login-cockpit-card .pro-input-field .mud-input-outlined,
.mud-dark .login-cockpit-card .pro-input-field .mud-input-outlined {
    background-color: rgba(30, 41, 59, 0.75) !important;
    color: #F1F5F9 !important;
}

html.mud-dark .login-cockpit-card .pro-input-field .mud-input-outlined fieldset,
body.mud-dark .login-cockpit-card .pro-input-field .mud-input-outlined fieldset,
.mud-dark .login-cockpit-card .pro-input-field .mud-input-outlined fieldset {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

html.mud-dark .login-cockpit-card .pro-input-field:hover .mud-input-outlined fieldset,
body.mud-dark .login-cockpit-card .pro-input-field:hover .mud-input-outlined fieldset,
.mud-dark .login-cockpit-card .pro-input-field:hover .mud-input-outlined fieldset {
    border-color: rgba(255, 255, 255, 0.28) !important;
}

html.mud-dark .login-cockpit-card .pro-input-field:focus-within .mud-input-outlined,
body.mud-dark .login-cockpit-card .pro-input-field:focus-within .mud-input-outlined,
.mud-dark .login-cockpit-card .pro-input-field:focus-within .mud-input-outlined {
    background-color: rgba(30, 41, 59, 0.98) !important;
    color: #FFFFFF !important;
}

html.mud-dark .sso-card-pill,
body.mud-dark .sso-card-pill,
.mud-dark .sso-card-pill {
    background: rgba(30, 41, 59, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #F1F5F9 !important;
}

html.mud-dark .sso-card-pill:hover:not(:disabled),
body.mud-dark .sso-card-pill:hover:not(:disabled),
.mud-dark .sso-card-pill:hover:not(:disabled) {
    background: rgba(242, 113, 28, 0.18) !important;
    border-color: var(--af-brand-orange, #F2711C) !important;
    color: #FFFFFF !important;
}

html.mud-dark .login-divider-line,
body.mud-dark .login-divider-line,
.mud-dark .login-divider-line {
    background: rgba(255, 255, 255, 0.10) !important;
}

html.mud-dark .login-register-box,
body.mud-dark .login-register-box,
.mud-dark .login-register-box {
    background: rgba(30, 41, 59, 0.40) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

/* ==========================================================
   KANBAN WORKFLOW BOARD — OVERRIDES GLOBAUX MODE SOMBRE
   ========================================================== */
html.mud-dark .workflow-column,
body.mud-dark .workflow-column,
.mud-dark .workflow-column {
    background: linear-gradient(180deg, rgba(22, 30, 48, 0.88) 0%, rgba(15, 23, 42, 0.92) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

html.mud-dark .workflow-column.drop-zone-active,
body.mud-dark .workflow-column.drop-zone-active,
.mud-dark .workflow-column.drop-zone-active {
    background: rgba(242, 113, 28, 0.14) !important;
    border-color: var(--audiofab-orange, #F2711C) !important;
    box-shadow: 0 0 0 2px var(--audiofab-orange) inset, 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 25px rgba(242, 113, 28, 0.25) !important;
}

html.mud-dark .column-header,
body.mud-dark .column-header,
.mud-dark .column-header {
    background: rgba(20, 27, 45, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.mud-dark .column-title,
body.mud-dark .column-title,
.mud-dark .column-title {
    color: #F1F5F9 !important;
}

html.mud-dark .column-count,
body.mud-dark .column-count,
.mud-dark .column-count {
    background: rgba(242, 113, 28, 0.20) !important;
    color: #FB923C !important;
    border-color: rgba(242, 113, 28, 0.40) !important;
}

html.mud-dark .empty-column-placeholder,
body.mud-dark .empty-column-placeholder,
.mud-dark .empty-column-placeholder {
    border: 1.5px dashed rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

html.mud-dark .workflow-card,
body.mud-dark .workflow-card,
.mud-dark .workflow-card {
    background: linear-gradient(155deg, rgba(28, 38, 58, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.50) !important;
    color: #F1F5F9 !important;
}

html.mud-dark .workflow-card:hover,
body.mud-dark .workflow-card:hover,
.mud-dark .workflow-card:hover {
    border-color: var(--audiofab-orange, #F2711C) !important;
    box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.70), 0 0 16px rgba(242, 113, 28, 0.25) !important;
}

html.mud-dark .workflow-card.is-urgent,
body.mud-dark .workflow-card.is-urgent,
.mud-dark .workflow-card.is-urgent {
    border-left: 4px solid var(--clinical-right, #DE1D53) !important;
    box-shadow: 0 4px 20px rgba(222, 29, 83, 0.30), 0 0 10px rgba(222, 29, 83, 0.15) inset !important;
}

html.mud-dark .card-avatar-neo,
body.mud-dark .card-avatar-neo,
.mud-dark .card-avatar-neo {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1.5px solid rgba(129, 140, 248, 0.3) !important;
    color: #818CF8 !important;
}

html.mud-dark .kanban-action-btn,
body.mud-dark .kanban-action-btn,
.mud-dark .kanban-action-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    color: #CBD5E1 !important;
}

html.mud-dark .kanban-action-btn:hover:not(:disabled),
body.mud-dark .kanban-action-btn:hover:not(:disabled),
.mud-dark .kanban-action-btn:hover:not(:disabled) {
    background: rgba(242, 113, 28, 0.22) !important;
    color: var(--audiofab-orange, #F2711C) !important;
    border-color: var(--audiofab-orange, #F2711C) !important;
    box-shadow: 0 0 10px rgba(242, 113, 28, 0.30) !important;
}

html.mud-dark .card-dragging,
body.mud-dark .card-dragging,
.mud-dark .card-dragging {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 2px dashed var(--audiofab-orange, #F2711C) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 20px rgba(242, 113, 28, 0.40) !important;
}

/* ==========================================================
   ONGLETS MODERNES (MUDTABS) — CONTRASTE ÉLEVÉ & FINESSE
   ========================================================== */
.custom-modern-tabs .mud-tabs-tabbar {
    background: transparent !important;
    border-bottom: 2px solid var(--glass-border) !important;
    padding: 0 8px;
    gap: 6px;
}

.custom-modern-tabs .mud-tab {
    font-weight: 700 !important;
    font-size: 0.84rem !important;
    text-transform: none !important;
    letter-spacing: 0.02em !important;
    padding: 10px 18px !important;
    border-radius: 12px 12px 0 0 !important;
    transition: all 0.2s ease !important;
    color: var(--slate-700, #334155) !important;
    opacity: 0.85;
}

.custom-modern-tabs .mud-tab:hover {
    color: var(--mud-palette-primary, #F2711C) !important;
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.08) !important;
    opacity: 1;
}

.custom-modern-tabs .mud-tab.mud-tab-active {
    color: var(--mud-palette-primary, #F2711C) !important;
    font-weight: 900 !important;
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.12) !important;
    border-bottom: 3px solid var(--mud-palette-primary, #F2711C) !important;
    opacity: 1;
}

.custom-modern-tabs .mud-tab-slider {
    height: 3px !important;
    border-radius: 3px !important;
    background-color: var(--mud-palette-primary, #F2711C) !important;
}

html.mud-dark .custom-modern-tabs .mud-tab,
body.mud-dark .custom-modern-tabs .mud-tab,
.mud-dark .custom-modern-tabs .mud-tab {
    color: #CBD5E1 !important;
}

html.mud-dark .custom-modern-tabs .mud-tab:hover,
body.mud-dark .custom-modern-tabs .mud-tab:hover,
.mud-dark .custom-modern-tabs .mud-tab:hover {
    color: #F8FAFC !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

html.mud-dark .custom-modern-tabs .mud-tab.mud-tab-active,
body.mud-dark .custom-modern-tabs .mud-tab.mud-tab-active,
.mud-dark .custom-modern-tabs .mud-tab.mud-tab-active {
    color: #FB923C !important;
    background: rgba(242, 113, 28, 0.18) !important;
    border-bottom: 3px solid var(--mud-palette-primary, #F2711C) !important;
}

/* ==========================================================
   HARMONIE GÉOMÉTRIQUE & FINESSE (SUPPRESSION DES BLOCS DURS)
   ========================================================== */
.stl-viewer-wrapper {
    border-radius: 20px !important;
    border: 1.5px solid var(--glass-border) !important;
    background: var(--mud-palette-surface) !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.stl-viewer-wrapper.left-ear-studio-accent {
    border-top: 4px solid var(--clinical-left, #1A73E8) !important;
}

.stl-viewer-wrapper.right-ear-studio-accent {
    border-top: 4px solid var(--clinical-right, #DE1D53) !important;
}

.stl-viewer-wrapper:hover {
    border-color: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.4) !important;
    box-shadow: 0 8px 24px -4px rgba(38, 47, 115, 0.08) !important;
}

.stl-drop-zone-modern {
    border-radius: 18px !important;
    border: 2px dashed rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.25) !important;
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.02) !important;
    transition: all 0.25s ease;
}

.stl-drop-zone-modern:hover {
    border-color: var(--mud-palette-primary, #F2711C) !important;
    background: rgba(var(--mud-palette-primary-rgb, 242, 113, 28), 0.06) !important;
}

html.mud-dark .stl-viewer-wrapper,
.mud-dark .stl-viewer-wrapper {
    background: rgba(15, 23, 42, 0.70) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html.mud-dark .stl-drop-zone-modern,
.mud-dark .stl-drop-zone-modern {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

html.mud-dark .superadmin-org-card,
body.mud-dark .superadmin-org-card,
.mud-dark .superadmin-org-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.70) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html.mud-dark .superadmin-org-card:hover,
body.mud-dark .superadmin-org-card:hover,
.mud-dark .superadmin-org-card:hover {
    border-color: var(--audiofab-orange) !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4) !important;
}

html.mud-dark .custom-glass-input,
body.mud-dark .custom-glass-input,
.mud-dark .custom-glass-input {
    background: rgba(30, 41, 59, 0.6) !important;
    color: #F1F5F9 !important;
}
.mud-color-picker-input .mud-input-adornment-start {
    margin-right: 8px;
}

.mud-color-picker-input .mud-color-picker-preview {
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

/* Harmonisation des inputs : pas de coins carrés brutaux */
.mud-input-outlined {
    border-radius: 12px !important;
}

.mud-input-outlined fieldset {
    border-radius: 12px !important;
}
