
.filters {
    background: #ffffff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (min-width: 768px)
{
    .filters
    {
        width: 340px;
        position: sticky;
        top: calc(var(--header-height) + 1rem);
        height: calc(100vh - var(--header-height) - 2rem);
    }
}

@media (max-width: 768px)
{
    .filters
    {
        display: none;
    }

    .filters.is-open
    {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        z-index: 2000;
        overflow-y: auto;
        padding: 1rem;
    }
}

/* Boutons de contrôle tout en haut */
.global-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #1e3c72;
    margin-bottom: 0.5rem;
}

.global-controls button {
    background: none;
    border: none;
    padding: 4px; /* Un petit padding pour la zone de clic sans grossir le bouton */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.global-controls button:hover {
    opacity: 1;
}

.global-controls button svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease, color 0.2s ease;
    color: #64748b; /* Gris pro par défaut */
}

.global-controls button:hover svg {
    color: #1e3c72; /* Ta couleur bleu Politx au hover */
    transform: scale(1.1); /* Petit effet de dynamisme */
}

/* Optionnel : Rotation de l'icône de pliage quand on clique */
.btn-global-toggle-fold.is-folded svg {
    transform: rotate(180deg);
}

.btn-global-toggle-fold svg {
    transition: transform 0.2s ease;
}

/* Groupes de Nuances */
.nuance-group {
    padding: 0.6rem 0;
    border-bottom: 1px solid #edf0f5;
}

.nuance-header {
    display: flex;
    justify-content: space-between; /* Pour pousser les contrôles à droite */
    align-items: center;
    padding: 0.5rem 0;
}

.nuance-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #1e3c72;
}

.nuance-controls {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.nuance-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s;
    width: 24px;
}

/* Blocs d'Entités */
.nuance-entities {
    margin-left: 0.5rem;
}

.entity-block {
    margin: 0.4rem 0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.25rem 0;
}

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
}

.entity-info {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 600;
    color: #2a5298;
    font-size: 0.95rem;
}

.btn-entity-toggle-check {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #1e3c72;
}

.entity-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    width: 20px;
}

/* Pour les entités sans profils */
.entity-header.standalone {
    padding-left: 0.4rem;
}

.entity-content {
    margin-left: 1.8rem;
    padding-bottom: 0.4rem;
}

/* Sources & Labels */
.source-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
}

.source-label:hover {
    background: none;
}

.source-name {
    flex: 1;
    font-size: 0.9rem;
}

/* Boutons Select Only (les flèches →) */
.btn-nuance-select-only, 
.btn-entity-select-only {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9rem;
    line-height: 1;
    color: #64748b;
    transition: all 0.2s;
}

.btn-nuance-select-only:hover, 
.btn-entity-select-only:hover {
    background: #1e3c72;
    color: #ffffff;
    border-color: #1e3c72;
}

.source-checkbox, 
.btn-nuance-toggle-check {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    accent-color: #1e3c72; /* Couleur pro pour les navigateurs modernes */
}

.btn-nuance-toggle-check {
    vertical-align: middle;
}

.source-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 0.5rem;
    transition: background 0.15s;
    border-radius: 6px;
}

.source-row:hover {
    background: #eef2f8;
}

.btn-source-select-only {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
    opacity: 0; /* Invisible par défaut */
    transition: all 0.2s;
}

/* Le bouton n'apparaît qu'au survol de la ligne pour ne pas surcharger l'UI */
.source-row:hover .btn-source-select-only {
    opacity: 1;
}

.btn-source-select-only:hover {
    background: #1e3c72;
    color: #fff;
    border-color: #1e3c72;
}

.nuance-toggle, .entity-toggle {
    display: inline-block; /* Indispensable pour le transform */
    transition: transform 0.2s ease;
    transform: rotate(0deg); /* Ouvert = ▾ */
}

.nuance-toggle[aria-expanded="false"], 
.entity-toggle[aria-expanded="false"] {
    transform: rotate(-90deg);
}

/* Aspect désactivé pour la ligne */
.disabled-source {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
    background: #f9f9f9;
}

/* On neutralise le hover sur les éléments désactivés */
.disabled-source:hover {
    background: #f9f9f9 !important;
}

/* Style pour l'icône de remplacement de la checkbox */
.no-rss-icon {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 5px;
    line-height: 13px;
    text-align: center;
    color: #cc0000;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #eee;
}

/* On grise le texte */
.disabled-source .source-name {
    color: #888;
    font-style: italic;
}
