/* --- Bascule Secteur / Pack --- */
.apps-filter-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 20px;
}
.apps-filter-mode__label {
    color: var(--grey, #525252);
    font-size: 14px;
}
.apps-filter-mode__switch {
    display: inline-flex;
    padding: 4px;
    border-radius: 500px;
    background-color: #efe8fd;
}
.apps-filter-mode__btn {
    padding: 7px 22px;
    border: 0;
    border-radius: 500px;
    background-color: transparent;
    color: var(--blue, #5914e6);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease;
}
.apps-filter-mode__btn.is-active {
    background-color: var(--white, #fff);
    box-shadow: 0 2px 8px rgba(89, 20, 230, .18);
}
.apps-filter-mode__btn:focus-visible {
    outline: 3px solid var(--darkblue, #350d9b);
    outline-offset: 2px;
}

/* --- Filtre par catégorie --- */
.apps-filter {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0;
}
.apps-filter__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border: 2px solid var(--blue, #5914e6);
    border-radius: 500px;
    background-color: var(--white, #fff);
    color: var(--blue, #5914e6);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.apps-filter__btn:hover {
    background-color: #efe8fd;
}
.apps-filter__btn.is-active {
    background-color: var(--blue, #5914e6);
    color: var(--white, #fff);
    box-shadow: 0 6px 18px rgba(89, 20, 230, .25);
}
.apps-filter__btn:focus-visible {
    outline: 3px solid var(--darkblue, #350d9b);
    outline-offset: 2px;
}
.apps-filter[hidden],
.apps-filter__btn[hidden] {
    display: none;
}
.apps-filter__count {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 500px;
    background-color: rgba(89, 20, 230, .1);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.apps-filter__btn.is-active .apps-filter__count {
    background-color: rgba(255, 255, 255, .25);
}

/* --- Grille des applications --- */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 40px
}

/* --- Carte application (entièrement cliquable) --- */
.app-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 96px;
    padding: 16px 20px 16px 16px;
    border-radius: 14px;
    background-color: var(--lightgrey, #f6f6f6);
    text-align: left;
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.app-card:hover,
.app-card:focus-within {
    background-color: #efe8fd;
    box-shadow: 0 8px 24px rgba(89, 20, 230, .12);
    transform: translateY(-2px);
}
.app-card__icon {
    display: flex;
    flex: 0 0 60px;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background-color: var(--blue, #5914e6);
}
.app-card__icon img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
}
/* Icônes de la sidebar admin : la tuile colorée est déjà dans le SVG */
.app-card__icon--tile {
    background-color: transparent;
}
.app-card__icon--tile img {
    width: 100%;
    height: 100%;
}
/* Pictos sans icône dédiée : couleur de l'espace correspondant dans la sidebar */
.app-card__icon--sales {
    background-color: #73b657;
}
.app-card__icon--accounting {
    background-color: #18bc9b;
}
.app-card__icon--helpdesk {
    background-color: #9158fd;
}
.app-card--ai-assistant .app-card__icon {
    background-color: #bce254;
}
.app-card__body {
    min-width: 0;
}
/* !important nécessaire : le thème force h2 { font-size: 36px !important } */
.main-content .app-card__title {
    margin: 0 0 4px;
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: var(--black, #241940);
    text-align: left;
    transition: color .2s ease;
}
.app-card:hover .app-card__title {
    color: var(--blue, #5914e6);
}
.main-content .app-card__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--grey, #525252);
    text-align: left;
}
.app-card__link,
.app-card__link:hover,
.app-card__link:focus {
    color: inherit;
    text-decoration: none;
}
/* Étend le lien à toute la carte */
.app-card__link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 14px;
}
.app-card__link:focus-visible {
    outline: none;
}
.app-card__link:focus-visible::after {
    outline: 3px solid var(--darkblue, #350d9b);
    outline-offset: 2px;
}

/* --- États du filtre --- */
.app-card.is-hidden {
    display: none;
}
.app-card.is-appearing {
    animation: appsFilterIn .35s ease backwards;
}
@keyframes appsFilterIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .apps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .apps-grid {
        margin-bottom: 20px;
    }
    .apps-filter {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 4px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .apps-filters {
        border-radius: 12px;
        background-color: var(--lightgrey, #f6f6f6);
        padding: 10px;
    }
    .apps-filter::-webkit-scrollbar {
        display: none;
    }
    .apps-filter__btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        padding: 8px 16px;
        font-size: 14px;
    }
}
@media (max-width: 744px) {
    .apps-filters {
        position: sticky;
        z-index: 1;
        top: 150px;
    }
}
@media (max-width: 575px) {
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .app-card {
        min-height: 84px;
        padding: 12px 16px 12px 12px;
    }
    .app-card__icon {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
    }
    .apps-filters {
        top: 90px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .apps-filter__btn,
    .apps-filter-mode__btn,
    .app-card,
    .main-content .app-card__title {
        transition: none;
    }
    .app-card:hover,
    .app-card:focus-within {
        transform: none;
    }
    .app-card.is-appearing {
        animation: none;
    }
}