/* Dashboard Styles */
.dashboard-container {
    margin: 0 auto;
    padding: 0;

    /* Header */
    .dashboard-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        border-bottom: 1px solid var(--primary-color);
        gap: 10px;
        flex-wrap: wrap;

        h1 {
            color: var(--primary-black);
            display: flex;
            align-items: center;
            font-size: 30px;
            font-weight: 600;
            margin: 0;
            img{
                width: 32px;
                height: 32px;
                margin-right: 10px;
            }
        }
        
        #createExpertiseBtn {
            padding: 20px;
            max-width: 250px;
        }
    }

    .dashboard-header-left {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .credits-available {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        color: var(--primary-color);
        font-weight: 700;
        font-size: 18px;
    }

    .credits-buy-btn {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        background: var(--primary-color);
        color: var(--white) !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        flex-shrink: 0;
        box-shadow: var(--shadow-sm);
    }

    .credits-buy-btn:hover,
    .credits-buy-btn:focus,
    .credits-buy-btn:active,
    .credits-buy-btn:visited {
        color: var(--white) !important;
        text-decoration: none;
        background: var(--primary-color);
    }

    .credits-buy-btn i {
        font-size: 14px;
        line-height: 1;
    }
    .dashboard-subheader{
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-bottom: 0px;
        padding: 15px 0;
        .dashboard-stats{
            font-size: 20px;
            font-weight: 500;
            color: var(--primary-black);
        }
    }

    /* Pagination Controls */
    .pagination-controls {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 20px;
        margin-bottom: 20px;
        padding: 15px 0;
        
        .search-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            
            .search-toggle {
                width: 35px;
                padding:0;
                height: 35px;
                border-radius: 50%;
                border: 2px solid var(--primary-color);
                background: var(--white);
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: all 0.3s ease;
                z-index: 2;
                
                img {
                    width: 16px;
                }
                
                &:hover {
                    background: var(--primary-light);
                    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                }
            }
            
            .search-input {
                position: absolute;
                right: 0;
                margin:0;
                padding: 15px;
                width: 40px;
                height: 40px;
                border-radius: 50px;
                border: 2px solid var(--primary-color);
                background: var(--white);
                padding: 0 15px 0 50px;
                font-size: 14px;
                color: var(--primary-black);
                transition: all 0.3s ease;
                opacity: 0;
                pointer-events: none;
                
                &::placeholder {
                    color: #2260FF80;
                }
                
                &:focus {
                    outline: none;
                    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
                }
            }
            
            &.active {
                .search-toggle {
                    background: var(--primary-color);
                    
                    img {
                        filter: brightness(0) invert(1);
                    }
                }
                
                .search-input {
                    min-width: 250px;
                padding: 15px;

                    margin:0;
                    opacity: 1;
                    pointer-events: auto;
                }
            }
        }
        
        .per-page-control,
        .page-control {
            display: flex;
            align-items: center;
            gap: 10px;
            
            label {
                font-size: 14px;
                font-weight: 500;
                color: var(--primary-black);
                margin: 0;
                white-space: nowrap;
            }
            
            .select-wrapper {
                position: relative;
                display: inline-block;
                
                select {
                    background: var(--white);
                    border: 1px solid var(--primary-color);
                    border-radius: 8px;
                    padding: 8px 32px 8px 12px;
                    margin:0;
                    font-size: 14px;
                    color: var(--primary-color);
                    cursor: pointer;
                    transition: all 0.3s ease;
                    width: 70px;
                    appearance: none;
                    -webkit-appearance: none;
                    -moz-appearance: none;
                    
                    &:focus {
                        outline: none;
                        border-color: var(--primary-color);
                        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
                    }
                    
                    &:hover {
                        border-color: var(--primary-color);
                        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                    }
                }
                
                .select-arrow {
                    position: absolute;
                    right: 10px;
                    top: 50%;
                    transform: translateY(-50%);
                    width: 12px;
                    height: 12px;
                    pointer-events: none;
                }
            }
        }
        
        .btn-filter {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            background: #F4F4F4;
            border: none;
            border-radius: 50px;
            font-size: 14px;
            font-weight: 500;
            color: var(--primary-black);
            cursor: pointer;
            transition: all 0.3s ease;
            
            img {
                width: 20px;
            }
            
            &:hover {
                background: #E8E8E8;
                transform: translateY(-1px);
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            }
            
            &:active {
                transform: translateY(0);
            }
            
            .filter-badge {
                position: relative;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                min-width: 22px;
                height: 22px;
                padding: 0 6px;
                background-color: var(--primary-color);
                border-radius: 50px;
                font-size: 12px;
                font-weight: 600;
                color: #fff;
                margin-left: 4px;
                cursor: pointer;
                transition: all 0.2s ease;
                
                .badge-count {
                    display: block;
                }
                
                .badge-clear {
                    display: none;
                    font-size: 16px;
                    line-height: 1;
                }
                
                &:hover {
                    background-color: #dc3545;
                    transform: scale(1.1);
                    
                    .badge-count {
                        display: none;
                    }
                    
                    .badge-clear {
                        display: block;
                    }
                }
            }
        }
    }


    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        background: var(--bg-primary);
        border-radius: 12px;
        border: 1px solid var(--border-light);

        i {
            font-size: 4rem;
            color: var(--border-medium);
            margin-bottom: 20px;
        }

        h3 {
            color: var(--text-primary);
            font-size: 1.5rem;
            margin-bottom: 12px;
        }

        p {
            color: var(--text-muted);
            font-size: 1rem;
            margin: 0;
        }
    }
    
    /* Empty Search State */
    .empty-search-state {
        text-align: center;
        padding: 40px 20px;
        background: var(--bg-primary);
        border-radius: 12px;
        border: 1px solid var(--border-light);
        margin-top: 20px;

        i {
            font-size: 3rem;
            color: var(--border-medium);
            margin-bottom: 15px;
        }

        h3 {
            color: var(--text-primary);
            font-size: 1.25rem;
            margin-bottom: 8px;
        }

        p {
            color: var(--text-muted);
            font-size: 0.9rem;
            margin: 0;
        }
    }

    /* Loading local pour les expertises */
    .expertises-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px 20px;
        min-height: 300px;
        
        .spinner {
            width: 50px;
            height: 50px;
            border: 4px solid var(--border-light);
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin-bottom: 20px;
        }
        
        p {
            color: var(--primary-color);
            font-size: 16px;
            font-weight: 500;
            margin: 0;
        }
    }
    
    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    /* Expertises Grid */
    .expertises-grid{
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        overflow-x: auto;
        min-width: min-content;
        min-height: 520px;
        #expertisesListContainer {
            padding-bottom: 260px;
        }
        .expertise-item:nth-child(odd) {
            background-color: #f8f8f8;
            
            
        }

        /* Requérant Sections */
        .requerent-section {
            margin-bottom: 40px;
            padding: 20px;
            background: var(--bg-primary);
            border-radius: 12px;
            border: 1px solid var(--border-light);
            
            .requerent-title {
                color: var(--primary-black);
                font-size: 1.2rem;
                font-weight: 600;
                margin: 0 0 20px 0;
                padding: 0 15px;
                border-bottom: 2px solid var(--primary-color);
                padding-bottom: 8px;
            }

            .expertises-grid-header {
                margin-bottom: 10px;
            }
        }
        .expertises-grid-header{
            display: grid;
            grid-template-columns: 2fr 80px 1fr 1fr 1fr 100px 30px;
            gap: 10px;
            padding : 0 15px;
            grid-template-rows: auto;
            border-bottom: 1px solid #E6E6E6;
            min-width: 0;

            .expertises-grid-header-item{
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 14px;
                font-weight: 600;
                color: var(--primary-black);
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                min-width: 0;

                &.no-center{
                    justify-content: flex-start;
                }

                span {
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    min-width: 0;
                }

                &.sortable {
                    cursor: pointer;
                    user-select: none;
                    gap: 6px;

                    &:hover {
                        color: var(--primary-color);
                    }

                    .sort-indicator {
                        flex-shrink: 0;
                        width: 14px;
                        height: 14px;
                        opacity: 0.4;
                    }

                    .sort-indicator.sort-asc::after {
                        content: '';
                        display: block;
                        width: 0;
                        height: 0;
                        margin-left: 4px;
                        border-left: 4px solid transparent;
                        border-right: 4px solid transparent;
                        border-bottom: 5px solid currentColor;
                    }

                    .sort-indicator.sort-desc::after {
                        content: '';
                        display: block;
                        width: 0;
                        height: 0;
                        margin-left: 4px;
                        border-left: 4px solid transparent;
                        border-right: 4px solid transparent;
                        border-top: 5px solid currentColor;
                    }

                    &.sortable .sort-indicator.sort-asc,
                    &.sortable .sort-indicator.sort-desc {
                        opacity: 1;
                    }
                }
            }
        }
        .expertise-item{
            position: relative;
            display: grid;
            grid-template-columns: 2fr 80px 1fr 1fr 1fr 100px 30px;
            gap: 10px;
            grid-template-rows: auto;
            padding : 15px;
            min-width: 0;

            & > * {
                min-width: 0;
            }

            &:hover{
                cursor: pointer;
            }

            .expertise-link-wrapper {
                display: contents;
                text-decoration: none;
                color: inherit;

                &:hover {
                    text-decoration: none;
                    color: inherit;
                }
            }

            .expertise-field{
                display: flex;
                align-items: center;
                justify-content: center;
                color : #000;
                overflow: hidden;
                min-width: 0;

                &.expertise-user {
                    text-overflow: ellipsis;
                    white-space: nowrap;

                    img {
                        flex-shrink: 0;
                    }
                }

                &.expertise-requerent {
                    font-size: 14px;
                    font-weight: 400;

                    span {
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                        max-width: 100%;
                        min-width: 0;
                    }
                }

                &.expertise-date span,
                &.expertise-created-date span {
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    max-width: 100%;
                    min-width: 0;
                }
            }

            .expertise-title{
                font-size: 14px;
                display: flex;
                align-items: center;
                color : #000;
                font-weight: 400;
                text-decoration: none;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                min-width: 0;
            }

            .expertise-status{
                display: flex;
                align-items: center;
                justify-content: center;
                position: relative;
                cursor: pointer;
                overflow: hidden;
                min-width: 0;

                .status-select {
                    padding: 5px 10px;
                    margin: 0;
                    width: 100%;
                    max-width: 100%;
                    font-size: 12px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    border-radius: 20px;
                    border: none;
                    background: transparent;
                    cursor: pointer;
                    outline: none;
                    text-align: center;
                    transition: all 0.2s ease;
                    
                    /* &:focus {
                        box-shadow: 0 0 0 2px var(--primary-color);
                    } */
                    
                    option {
                        color: #000;
                        background: white;
                    }
                }
                
                .status-text {
                    padding: 5px 10px;
                    margin: 0;
                    width: fit-content;
                    font-size: 12px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    border-radius: 20px;
                    border: none;
                    background: transparent;
                    text-align: center;
                    transition: all 0.2s ease;
                    font-weight: 500;
                }
                
                &[data-status="ongoing"] {
                    .status-select {
                        color : #375DFB;
                        background-color: #2260FF1A;
                    }
                    .status-text {
                        color : #375DFB;
                        background-color: #2260FF1A;
                    }
                }
                &[data-status="completed"] {
                    .status-select {
                        color : #22BB00;
                        background-color: #DCF7DA;
                    }
                    .status-text {
                        color : #22BB00;
                        background-color: #DCF7DA;
                    }
                }
                &[data-status="to_validate"] {
                    .status-select {
                        color : #000;
                        background-color: #E6E6E6;
                    }
                    .status-text {
                        color : #000;
                        background-color: #E6E6E6;
                    }
                }
                &[data-status="draft"] {
                    .status-text {
                        color : #666;
                        background-color: #F5F5F5;
                    }
                }
                
            }
            .expertise-actions{
                display: flex;
                align-items: center;
                justify-content: center;
                
                .open-menu {
                    background: none;
                    border: none;
                    cursor: pointer;
                    font-size: 16px;
                    color: #666;
                    padding: 5px;
                    border-radius: 4px;
                    transition: all 0.2s ease;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    
                    &:hover {
                        color: #333;
                    }
                }
            }
            .expertise-actions-menu{
                display: none;
                position: absolute;
                top: 70%;
                right: 5px                     ;
                background-color: #fff;
                flex-direction: column;
                z-index: 10;
                box-shadow: 0px 0px 9px 0px #3333331A;
                border-radius: 10px;
                width: 280px;
                border: 1px solid #e0e0e0;
                
                .menu-item{
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    gap: 10px;
                    padding: 10px 15px;
                    background-color: #fff;
                    border: none;
                    outline: none;
                    font-size: 14px;
                    font-weight: 500;
                    color: #000;
                    text-decoration: none;
                    text-align: left;
                    transition: all 0.2s ease;
                    img{
                        width: 15px;
                        /* height: 15px; */
                    }
                    &:first-child {
                        border-radius: 10px 10px 0 0;
                    }
                    
                    &:last-child {
                        border-radius: 0 0 10px 10px;
                    }
                    
                    &:hover{
                        background-color: #F6F7FAB2;
                        color : #2260FF;
                        font-weight: 700;
                        img{
                            filter: invert(25%) sepia(99%) saturate(2787%) hue-rotate(222deg) brightness(106%) contrast(105%);
                        }
                    }
                    
                    /* Styles pour les boutons désactivés */
                    &.disabled,
                    &:disabled {
                        opacity: 0.5;
                        cursor: not-allowed;
                        color: #999;
                        position: relative;
                        
                        img {
                            filter: grayscale(100%);
                            opacity: 0.6;
                        }
                        
                        &:hover {
                            background-color: #fff;
                            color: #999;
                            font-weight: 500;
                            
                            img {
                                filter: grayscale(100%);
                                opacity: 0.6;
                            }
                        }
                        
                        /* Permettre les événements de souris pour les tooltips sur les boutons */
                        &:not([href]) {
                            pointer-events: auto;
                        }
                        
                        /* S'assurer que les liens désactivés ne sont pas cliquables */
                        &[href="#"] {
                            pointer-events: none;
                        }
                    }
                }
                .menu-item-has-submenu {
                    position: relative;
                    cursor: pointer;
                    .menu-item-trigger {
                        display: flex;
                        align-items: center;
                        gap: 10px;
                        padding: 0;
                        width: 100%;
                        .submenu-arrow {
                            margin-left: auto;
                            font-size: 10px;
                            transition: transform 0.2s ease;
                        }
                    }
                    .submenu {
                        display: none;
                        position: absolute;
                        left: 0;
                        top: 100%;
                        min-width: 100%;
                        flex-direction: column;
                        background: #fff;
                        box-shadow: 0 2px 12px rgba(0,0,0,0.12);
                        border-radius: 8px;
                        border: 1px solid #e0e0e0;
                        z-index: 20;
                        padding: 4px 0;
                        .menu-item {
                            border-radius: 4px;
                            padding: 8px 12px;
                            margin: 0 4px;
                            width: auto;
                            min-width: 0;
                            &:first-child { border-radius: 4px; }
                            &:last-child { border-radius: 4px; }
                        }
                    }
                    &:hover .submenu {
                        display: flex;
                    }
                    &:hover .submenu-arrow {
                        transform: rotate(90deg);
                    }
                }
                .pdf-view-submenu,
                .pdf-regenerate-submenu {
                    max-height: 200px;
                    overflow-y: auto;
                }
                .delete-expertise-btn{
                    color : #FF0000;
                    &:hover{
                        color : #FF0000;
                        background-color: #ff00000f;
                        img{
                            filter : none;
                        }
                    }
                    
                    /* Styles spécifiques pour le bouton supprimer désactivé */
                    &.disabled,
                    &:disabled {
                        color: #ff9999;
                        
                        &:hover {
                            color: #ff9999;
                            background-color: #fff;
                            
                            img {
                                filter: grayscale(100%) brightness(1.5);
                                opacity: 0.6;
                            }
                        }
                    }
                }
            }
                         .expertise-actions-menu.open{
                 display: flex;
             }
             /* Dernière ligne : ouvrir le menu vers le haut pour éviter le scroll vertical */
             .expertise-item:last-child .expertise-actions-menu {
                 top: auto;
                 bottom: 100%;
                 margin-bottom: 8px;
             }
          }
          
          /* Styles spécifiques pour les expertises client */
          .expertise-item-client {
              grid-template-columns: 2fr 80px 1fr 1fr !important;
              
              .expertise-actions {
                  display: none !important;
              }
          }
          
          .expertises-grid-header-client {
              grid-template-columns: 2fr 80px 1fr 1fr !important;
          }
     }

    @media (max-width: 1000px) {
        .expertises-grid{
            .expertise-item{
                grid-template-columns: 2fr 1fr 1fr 30px;
                grid-template-rows: auto auto;

                .expertise-link-wrapper {
                    display: contents;
                }

                .expertise-title {
                    grid-row: 1;
                    grid-column: 1;
                }
                .expertise-status {
                    grid-row: 1;
                    grid-column: 2;
                }
                .expertise-user {
                    grid-row: 1;
                    grid-column: 3;
                    justify-content: flex-start;
                }
                .expertise-requerent {
                    grid-row: 2;
                    grid-column: 1;
                    justify-content: flex-start;
                }
                .expertise-date {
                    grid-row: 2;
                    grid-column: 2;
                    justify-content: flex-start;
                }
                .expertise-created-date {
                    grid-row: 2;
                    grid-column: 3;
                    justify-content: flex-start;
                }
                .expertise-actions {
                    grid-row: 1 / span 2;
                    grid-column: 4;
                }
            }
            .expertises-grid-header{
                display: none !important;
            }
        }
    }
    

    /* Modal Styles - Styles communs déplacés vers style.css */
    /* Form Styles */
    .form-group {
        margin-bottom: 20px;

        label {
            display: block;
            margin-bottom: 4px;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 0.875rem;
        }

        input[type="text"],
        select {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border-medium);
            border-radius: 6px;
            font-size: 0.875rem;
            color: var(--text-primary);
            background: var(--bg-primary);
            transition: all 0.3s;
            box-sizing: border-box;

            &:focus {
                outline: none;
                border-color: var(--primary-color);
                box-shadow: 0 0 0 3px var(--primary-focus);
            }
        }

        input[type="text"]::placeholder {
            color: var(--text-light);
        }
    }

    /* Requérant Select Container */
    .requerent-select-container {
        display: flex;
        gap: 10px;
        align-items: center;

        select {
            flex: 1;
        }

        .add-requerent-btn {
            padding: 8px 12px;
            min-width: 40px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            border: 1px solid var(--border-medium);
            background: var(--bg-primary);
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.3s;

            &:hover {
                background: var(--bg-secondary);
                border-color: var(--primary-color);
            }

            i {
                font-size: 14px;
            }
        }
    }

    /* Requérant Email Inputs */
    .requerent-email-input {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid var(--border-medium);
        border-radius: 6px;
        font-size: 0.875rem;
        color: var(--text-primary);
        background: var(--bg-primary);
        transition: all 0.3s;
        box-sizing: border-box;

        &:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--primary-focus);
        }
    }
    
    /* Styles pour les informations légales dans les modales de création */
    .legal-info-form {
        margin-top: 20px;
        padding: 20px;
        background: var(--bg-secondary);
        border-radius: 8px;
        border: 1px solid var(--border-light);
    }

    .legal-info-form h5 {
        margin: 0 0 20px 0;
        color: var(--text-primary);
        font-size: 16px;
        font-weight: 600;
    }

    .legal-info-form .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    .legal-info-form .form-row .form-group {
        margin-bottom: 0;
    }

    .legal-info-form .form-row .form-group label {
        display: block;
        margin-bottom: 8px;
        color: var(--text-primary);
        font-weight: 500;
        font-size: 0.875rem;
    }

    .legal-info-form .form-row .form-group input[type="text"],
    .legal-info-form .form-row .form-group input[type="email"] {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid var(--border-light);
        border-radius: 8px;
        font-size: 1rem;
        transition: all 0.3s;
        background: var(--white);
        box-sizing: border-box;
    }

    .legal-info-form .form-row .form-group input[type="text"]:focus,
    .legal-info-form .form-row .form-group input[type="email"]:focus {
        outline: none;
        border-color: var(--primary-color);
        background: var(--white);
        box-shadow: 0 0 0 3px var(--primary-focus);
    }

    .legal-info-form .form-row .form-group input[type="text"]:hover,
    .legal-info-form .form-row .form-group input[type="email"]:hover {
        border-color: var(--border-medium);
    }
    
    /* Responsive pour les informations légales */
    @media (max-width: 768px) {
        .legal-info-form .form-row {
            grid-template-columns: 1fr;
            gap: 15px;
        }
        
        .legal-info-form {
            padding: 15px;
        }
    }
    
    /* Modal élargie pour la création de requérant */
    .modal.requerent-create-modal .modal-content {
        max-width: 800px;
        width: 90%;
    }
    
    .modal.requerent-create-modal .modal-body {
        max-height: 80vh;
        overflow-y: auto;
    }

    .add-requerent-email-btn {
        margin-top: 10px;
        padding: 8px 16px;
        font-size: 0.875rem;
    }

    /* Delete Confirmation Styles */
    .delete-confirmation {
        text-align: center;
        padding: 20px 0;

        i {
            font-size: 3rem;
            color: var(--danger-color);
            margin-bottom: 20px;
        }

        p {
            margin: 12px 0;
            color: var(--text-primary);
        }

        .warning-text {
            color: var(--danger-hover);
            font-weight: 500;
            font-size: 0.875rem;
        }

        strong {
            color: var(--text-primary);
            font-weight: 600;
        }
    }

    /* Responsive Design */
    

    /* Animation for status change */
    .expertises-grid {
        .expertise-card.updating {
            opacity: 0.6;
            pointer-events: none;

            .status-select {
                background: var(--bg-tertiary);
                cursor: not-allowed;
            }
        }
    }

    /* Success/Error feedback */
    .status-feedback {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        color: var(--white);
        opacity: 0;
        transition: opacity 0.3s;

        &.success {
            background: var(--success-color);
            opacity: 1;
        }

        &.error {
            background: var(--danger-color);
            opacity: 1;
        }
    }
}

/* Create expertise: crédits info/warning */
#createExpertiseModal .modal-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

#createExpertiseModal .create-expertise-footer-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#createExpertiseModal .create-expertise-cost {
    font-size: 13px;
    color: var(--text-muted);
    text-align: right;
    font-style: italic;
}

#createExpertiseModal .create-expertise-warning {
    font-size: 13px;
    color: var(--danger-color);
    background: var(--danger-light);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    padding: 8px 10px;
}

#createExpertiseModal .create-expertise-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== MODAL MODIFICATION DU FORMULAIRE ===== */
#modifyFormModal .modal-content {
    max-width: 800px;
    width: 90%;
}

.template-selection {
    padding: 20px 0;
}

.modal-description {
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-size: 14px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-item {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #ffffff;
}

.template-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.template-item.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.template-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 6px;
}

.template-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-black);
}

.template-info p {
    margin: 0;
    font-size: 13px;
    color: var(--secondary-color);
    line-height: 1.4;
}

.template-selected-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.template-item.selected .template-selected-indicator {
    opacity: 1;
    transform: scale(1);
}

.template-selected-indicator i {
    color: white;
    font-size: 12px;
}

/* Responsive pour les templates */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .template-item {
        padding: 12px;
    }
    
    .template-image {
        height: 100px;
    }
}

/* ===== MODAL UNIFIÉE POUR MODIFIER L'EXPERTISE ===== */
.edit-section {
    margin-bottom: 24px;
}

.edit-section h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-black);
}

.section-description {
    margin: 0 0 16px 0;
    color: var(--secondary-color);
    font-size: 14px;
    line-height: 1.5;
}

.edit-section .btn {
    margin-top: 8px;
}

.separator {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 24px 0;
}

/* Modal élargie pour la modification unifiée */
#editExpertiseModal .modal-content {
    max-width: 800px;
    width: 90%;
}

#editExpertiseModal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

    @media (max-width: 750px) {
        .dashboard-container{
            padding:15px;
        }
        
        .dashboard-header {
            flex-direction: column;
            gap: 15px;
            align-items: stretch;
            
            h1 {
                font-size: 24px;
            }
            
            #createExpertiseBtn {
                width: 100%;
                max-width: 100%;
                justify-content: center;
            }
        }
        
        .pagination-controls {
            flex-direction: column;
            gap: 15px;
            align-items: stretch;
            
            .search-wrapper {
                width: 100%;
                justify-content: center;
                
                &.active {
                    .search-input {
                        width: calc(100% - 50px);
                    }
                }
            }
            
            .per-page-control,
            .page-control {
                flex: 1;
                
                .select-wrapper {
                    flex: 1;
                    
                    select {
                        width: 100%;
                        max-width: 100%;
                    }
                }
            }
            
            .btn-filter {
                width: 100%;
                justify-content: center;
            }
            
            .filter-wrapper {
                width: 100%;
            }
            
            .filters-popup {
                left: 0;
                right: 0;
                min-width: auto;
            }
        }
    }

    /* Popup de filtres */
    .filter-wrapper {
        position: relative;
    }

    .filters-popup {
        display: none;
        position: absolute;
        top: calc(100% + 5px);
        right: 0;
        background-color: #fff;
        box-shadow: 0px 0px 9px 0px #3333331A;
        border-radius: 10px;
        border: 1px solid #e0e0e0;
        z-index: 100;
        min-width: 280px;
        padding: 15px;
        padding-top: 40px;
        
        &.open {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        
        .filter-reset {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f4f4f4;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s ease;
            padding: 0;
            
            img {
                width: 16px;
                height: 16px;
            }
            
            &:hover {
                background-color: #e0e0e0;
                transform: rotate(180deg);
            }
        }
        
        .filters-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0 ;
            padding: 0;
        }
        
        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            
            .filter-label {
                color: var(--primary-color);
                font-weight: 500;
                font-size: 13px;
                padding-bottom: 5px;
                border-bottom: 1px solid var(--primary-color);
                margin: 0;
            }
            
            select, input[type="text"] {
                padding: 8px 12px;
                border: 1px solid var(--border-light);
                border-radius: 6px;
                font-size: 13px;
                color: var(--text-primary);
                background-color: var(--white);
                transition: all 0.2s ease;
                margin: 0;
                
                &:focus {
                    outline: none;
                    border-color: var(--primary-color);
                }
            }
            
            input[type="text"]::placeholder {
                color: var(--text-light);
                font-size: 12px;
            }

            .filter-date-range {
                display: flex;
                align-items: center;
                gap: 10px;
                flex-wrap: wrap;
            }

            .filter-input-date {
                flex: 1;
                min-width: 120px;
                margin:0;
            }

            .filter-date-sep {
                font-size: 13px;
                color: var(--text-muted);
                white-space: nowrap;
            }

            input[type="date"].filter-input {
                padding: 8px 12px;
                border: 1px solid var(--border-light);
                border-radius: 6px;
                font-size: 13px;
            }
        }
    }
