/* ═══════════════════════════════════════════════════════════
   Club Model Directory — Styles front-end v5.0
   Filtres : accordéons groupés, tri intégré, tags actifs
   ═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   BARRE RECHERCHE
   ══════════════════════════════════════════════════════════ */

.cmd-search-wrap { margin-bottom: 16px; }
.cmd-search-form { margin-bottom: 10px; }

.cmd-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.cmd-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    min-width: 0;
}
.cmd-search-input:focus { border-color: #54595F; }

.cmd-search-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    height: 42px !important;
    background: #fff !important;
    color: #444 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    user-select: none !important;
    box-shadow: none !important;
}
.cmd-search-btn:hover {
    background: #1E73BE !important;
    border-color: #1E73BE !important;
    color: #fff !important;
    box-shadow: 0 1px 4px rgba(30,115,190,.15) !important;
}
.cmd-search-btn.has-search {
    background: #1E73BE !important;
    border-color: #1E73BE !important;
    color: #fff !important;
}
.cmd-search-btn.has-search:hover {
    background: #1562a8 !important;
    border-color: #1562a8 !important;
    box-shadow: 0 2px 8px rgba(30,115,190,.4) !important;
}

.cmd-search-reset {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    background: #e53e3e !important;
    color: #fff !important;
    border: 1px solid #e53e3e !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
    transition: background .15s, border-color .15s, box-shadow .15s !important;
    box-shadow: none !important;
}
.cmd-search-reset:hover {
    background: #c53030 !important;
    border-color: #c53030 !important;
    color: #fff !important;
    box-shadow: 0 1px 4px rgba(229,62,62,.35) !important;
}

/* ══════════════════════════════════════════════════════════
   BARRE DE TRI
   ══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   TRI INLINE (avant le compteur)
   ══════════════════════════════════════════════════════════ */

.cmd-sort-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}
.cmd-sort-inline__spacer {
    flex: 1;
    min-width: 16px;
}
.cmd-sort-inline__count {
    font-size: 26px;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}
.cmd-sort-inline__pipe {
    color: #ccc;
    padding: 0 4px;
    user-select: none;
}
.cmd-sort-inline__dot {
    color: #ccc;
    user-select: none;
}
.cmd-sort-inline__label {
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .6px;
    white-space: nowrap;
}
/* Groupe nom + chevrons */
.cmd-sort-inline__group {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    white-space: nowrap;
}
.cmd-sort-inline__name {
    font-size: 13px;
    color: #888;
}
.cmd-sort-inline__name.is-active {
    color: #1E73BE;
    font-weight: 600;
}
/* Chevrons Font Awesome */
.cmd-sort-inline__chevron {
    display: inline-block;
    color: #ccc;
    text-decoration: none !important;
    transition: color .12s;
    vertical-align: middle;
    line-height: 1;
}
.cmd-sort-inline__chevron i {
    font-size: 9px !important;
    line-height: 1;
}
.cmd-sort-inline__chevron:hover { color: #555; }
.cmd-sort-inline__chevron.is-active { color: #1E73BE; }
/* Fiches par page */
.cmd-sort-inline__item {
    font-size: 13px;
    color: #888;
    text-decoration: none !important;
    transition: color .12s;
    white-space: nowrap;
}
.cmd-sort-inline__item:hover { color: #333; }
.cmd-sort-inline__item.is-active {
    color: #1E73BE;
    font-weight: 700;
}
/* Réinitialiser */
.cmd-reset-inline {
    font-size: 12px;
    color: #aaa;
    text-decoration: none !important;
    transition: color .12s;
}
.cmd-reset-inline:hover { color: #c00; }

@media (max-width: 600px) {
    .cmd-sort-inline { gap: 4px 6px; }
    .cmd-sort-inline__pipe { padding: 0 2px; }
}


/* ══════════════════════════════════════════════════════════
   BOUTON TIROIR DE FILTRES
   ══════════════════════════════════════════════════════════ */

.cmd-filters-drawer-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 0 16px 0 13px !important;
    height: 42px !important;
    background: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #444 !important;
    font-family: inherit !important;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    user-select: none !important;
    box-shadow: none !important;
}
.cmd-filters-drawer-btn:hover {
    background: #1E73BE !important;
    border-color: #1E73BE !important;
    color: #fff !important;
    box-shadow: 0 1px 4px rgba(30,115,190,.15) !important;
}
.cmd-filters-drawer-btn:hover .cmd-fdb-icon,
.cmd-filters-drawer-btn:hover .cmd-fdb-chevron { color: #fff !important; }
.cmd-filters-drawer-btn.is-open {
    background: #1E73BE !important;
    border-color: #1E73BE !important;
    color: #fff !important;
}
/* Filtres actifs → bouton bleu (même tiroir fermé) */
.cmd-filters-drawer-btn.has-filters {
    background: #1E73BE !important;
    border-color: #1E73BE !important;
    color: #fff !important;
}
.cmd-filters-drawer-btn.has-filters .cmd-fdb-chevron { color: rgba(255,255,255,.7) !important; }
.cmd-filters-drawer-btn.has-filters:hover {
    background: #1562a8 !important;
    border-color: #1562a8 !important;
    box-shadow: 0 2px 8px rgba(30,115,190,.4) !important;
}
.cmd-filters-drawer-btn.has-filters.is-open {
    background: #1E73BE !important;
    border-color: #1562a8 !important;
    color: #fff !important;
}
/* Badge blanc quand bouton bleu */
.cmd-filters-drawer-btn.has-filters .cmd-fdb-badge {
    background: rgba(255,255,255,.25) !important;
    color: #fff !important;
}

/* Animation intro : le tiroir s'entrouvre puis se referme */
/* Intro peek : tiroir ouvert instantanément, sans transition */
.cmd-filters-drawer.cmd-drawer-instant {
    transition: none !important;
}

.cmd-fdb-icon { flex-shrink: 0; }
.cmd-fdb-label { flex: 1; }

.cmd-fdb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #1E73BE;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.cmd-fdb-chevron {
    flex-shrink: 0;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    color: #aaa;
}
.cmd-filters-drawer-btn.is-open .cmd-fdb-chevron {
    transform: rotate(180deg);
}

/* ══════════════════════════════════════════════════════════
   TIROIR DE FILTRES — SLIDE DOWN/UP
   ══════════════════════════════════════════════════════════ */

.cmd-filters-drawer {
    /* Le tiroir : overflow caché pour le slide */
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s cubic-bezier(.4,0,.2,1);
}
.cmd-filters-drawer > * {
    overflow: hidden;
}
.cmd-filters-drawer.is-open {
    grid-template-rows: 1fr;
}

/* ══════════════════════════════════════════════════════════
   ACCORDÉONS DE FILTRES — avec animations stagger
   ══════════════════════════════════════════════════════════ */

.cmd-filters-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding-top: 4px;
}

/* Animation stagger à l'ouverture */
@keyframes cmd-panel-slidein {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cmd-filters-drawer.is-open .cmd-filter-panel {
    animation: cmd-panel-slidein .28s cubic-bezier(.4,0,.2,1) both;
}

/* Délais désynchronisés pour chaque panneau */
.cmd-filters-drawer.is-open .cmd-filter-panel:nth-child(1) { animation-delay: .04s; }
.cmd-filters-drawer.is-open .cmd-filter-panel:nth-child(2) { animation-delay: .10s; }
.cmd-filters-drawer.is-open .cmd-filter-panel:nth-child(3) { animation-delay: .16s; }
.cmd-filters-drawer.is-open .cmd-filter-panel:nth-child(4) { animation-delay: .22s; }
.cmd-filters-drawer.is-open .cmd-filter-panel:nth-child(5) { animation-delay: .28s; }

/* Pas d'animation si tiroir déjà ouvert au chargement (filtres actifs) */
.cmd-filters-drawer.is-open.cmd-no-anim .cmd-filter-panel {
    animation: none;
}

.cmd-filter-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.cmd-panel-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    text-align: left;
    transition: background .15s;
    font-family: inherit;
}
.cmd-panel-toggle:hover { background: #f0f1f2; }

.cmd-panel-icon { flex-shrink: 0; color: #54595F; }
.cmd-panel-title { flex: 1; }

.cmd-panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e8f0fe;
    color: #1E73BE;
    font-size: 10px;
    font-weight: 700;
    transition: background .2s, color .2s, transform .2s;
}
/* Panneau fermé avec filtres actifs : badge plus visible */
.cmd-filter-panel:not(.cmd-panel-open) .cmd-panel-badge {
    background: #1E73BE;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 1px 4px rgba(30,115,190,.4);
}

.cmd-panel-chevron {
    flex-shrink: 0;
    transition: transform .25s;
    color: #aaa;
}
.cmd-filter-panel.cmd-panel-open .cmd-panel-chevron {
    transform: rotate(180deg);
}

.cmd-panel-body {
    display: none;
    padding: 18px 20px 20px;
    border-top: 1px solid #e5e7eb;
}
.cmd-filter-panel.cmd-panel-open .cmd-panel-body {
    display: block;
}

/* Grille : flex row, chaque colonne centrée, séparateur vertical entre elles */
.cmd-panel-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
}
.cmd-panel-fg {
    display: flex;
    flex-direction: column;
    align-items: center;          /* centre label + chips horizontalement */
    gap: 8px;
    flex: 1 1 180px;
    min-width: 160px;
    padding: 4px 20px 12px;
    position: relative;
    text-align: center;
}
/* Séparateur vertical entre les blocs (sauf premier) */
.cmd-panel-fg + .cmd-panel-fg::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e5e7eb;
}
/* Les blocs --wide prennent toute la largeur et ont un séparateur horizontal en haut */
.cmd-panel-fg--wide {
    flex: 1 1 100%;
    min-width: 100%;
    padding: 12px 8px 4px;
    align-items: flex-start;
    text-align: left;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
}
.cmd-panel-fg--wide::before { display: none; }  /* pas de séparateur vertical */

/* Séparateur horizontal explicite (conservé pour compatibilité HTML existant) */
.cmd-panel-sep {
    flex: 1 1 100%;
    min-width: 100%;
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0 4px;
}

/* ── Layout en colonnes (panneaux Activités & Physique) ── */
.cmd-panel-grid--cols {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
}
.cmd-panel-col {
    flex: 1 1 0;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 20px 12px;
    position: relative;
}
/* Séparateur vertical entre colonnes */
.cmd-panel-col + .cmd-panel-col::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e5e7eb;
}
/* Dans les colonnes, les fg n'ont pas de centrage (texte à gauche) */
.cmd-panel-col .cmd-panel-fg {
    flex: none;
    min-width: unset;
    padding: 0;
    align-items: flex-start;
    text-align: left;
}
.cmd-panel-col .cmd-panel-fg::before { display: none; }
.cmd-panel-col .cmd-fg-label { justify-content: flex-start; }
.cmd-panel-col .cmd-checkbox-group,
.cmd-panel-col .cmd-radio-group { justify-content: flex-start; }

@media (max-width: 768px) {
    .cmd-panel-col { flex: 1 1 45%; }
}
@media (max-width: 600px) {
    .cmd-panel-col {
        flex: 1 1 100%;
        min-width: 100%;
        padding: 10px 8px;
        border-top: 1px solid #e5e7eb;
    }
    .cmd-panel-col:first-child { border-top: none; }
    .cmd-panel-col + .cmd-panel-col::before { display: none; }
}

/* Label centré pour blocs normaux */
.cmd-panel-fg:not(.cmd-panel-fg--wide) .cmd-fg-label {
    justify-content: center;
}
/* Chips centrées */
.cmd-panel-fg:not(.cmd-panel-fg--wide) .cmd-checkbox-group,
.cmd-panel-fg:not(.cmd-panel-fg--wide) .cmd-radio-group {
    justify-content: center;
}

.cmd-fg-label {
    font-size: 10px;
    font-weight: 700;
    color: #54595F;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cmd-fg-label-val {
    font-size: 11px;
    font-weight: 600;
    color: #54595F;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 1px 6px;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   RADIO PILLS
   ══════════════════════════════════════════════════════════ */

.cmd-radio-group { display: flex; flex-wrap: wrap; gap: 5px; }
.cmd-radio-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    user-select: none;
    line-height: 1;
}
.cmd-radio-pill input[type="radio"] {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.cmd-radio-pill:hover { background: #e9ecef; border-color: #adb5bd; }
.cmd-radio-pill.active { background: #1E73BE; color: #fff; border-color: #1E73BE; }
.cmd-radio-pill.active::after {
    content: '\00d7';
    margin-left: 5px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    opacity: .75;
}
.cmd-radio-pill.active:hover::after { opacity: 1; }

/* ══════════════════════════════════════════════════════════
   CHECKBOX PILLS
   ══════════════════════════════════════════════════════════ */

.cmd-checkbox-group { display: flex; flex-wrap: wrap; gap: 5px; }
.cmd-checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 16px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    user-select: none;
    line-height: 1;
}
.cmd-checkbox-pill input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.cmd-checkbox-pill:hover { background: #e9ecef; border-color: #adb5bd; }
.cmd-checkbox-pill.active { background: #1E73BE; color: #fff; border-color: #1E73BE; }
.cmd-checkbox-pill.active::before { content: '✓ '; font-size: 10px; font-weight: 700; }


/* ══════════════════════════════════════════════════════════
   FILTRES ACTIFS
   ══════════════════════════════════════════════════════════ */

.cmd-active-filters {
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; margin-top: 4px;
}
.cmd-active-tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; background: #eef2ff; color: #3730a3;
    border: 1px solid #c7d2fe; border-radius: 12px;
    font-size: 11px; font-weight: 600; text-decoration: none; transition: background .15s;
}
.cmd-active-tag--removable {
    cursor: pointer;
}
.cmd-active-tag--removable:hover {
    background: #e0e7ff;
}
.cmd-tag-remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px;
    background: #c7d2fe; color: #3730a3;
    border-radius: 50%; font-size: 12px; line-height: 1;
    transition: background .15s;
}
.cmd-active-tag--removable:hover .cmd-tag-remove {
    background: #818cf8; color: #fff;
}
.cmd-active-tag--reset {
    background: #fee2e2; color: #b91c1c; border-color: #fca5a5; cursor: pointer;
}
.cmd-active-tag--reset:hover { background: #fca5a5; text-decoration: none; }

/* ══════════════════════════════════════════════════════════
   COMPTEUR
   ══════════════════════════════════════════════════════════ */

/* cmd-results-count et cmd-reset-inline définis dans cmd-sort-inline */

/* ══════════════════════════════════════════════════════════
   FICHES
   ══════════════════════════════════════════════════════════ */

.cmd-directory { display: flex; flex-direction: column; gap: 10px; }
.cmd-card {
    background: transparent; border: 1px solid #54595F; border-radius: 10px;
    margin: 5px 0;
    animation: cmd-fadeInUp .4s ease both; transition: box-shadow .25s;
}
.cmd-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); }
@keyframes cmd-fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cmd-card-inner { display: flex; align-items: center; min-height: 100%; overflow: hidden; border-radius: 10px; }
.cmd-card-photo-col {
    flex: 0 0 33%; max-width: 33%;
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; padding: 15px;
    border-right: 1px solid #dee2e6; align-self: stretch; background: transparent;
    overflow: visible;
}
.cmd-card-photo {
    border-radius: 10px;
    animation: cmd-fadeIn .5s ease 100ms both; margin: 0;
    width: 200px; height: 200px; flex-shrink: 0;
}
.cmd-card-photo img.cmd-photo {
    width: 200px; height: 200px; display: block; border-radius: 10px;
    object-fit: cover; object-position: center top; transition: transform .3s, filter .3s;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,.25)) drop-shadow(0 2px 5px rgba(0,0,0,.14)) !important;
    border: 1px solid #fff !important;
    border-radius: 10px !important;
}
.cmd-photo-zoom {
    display: block; width: 200px; height: 200px; border-radius: 10px;
    overflow: visible; cursor: zoom-in; position: relative; padding: 0; border: none; background: none;
}
.cmd-photo-zoom::after {
    content: '\2315'; position: absolute; bottom: 6px; right: 8px;
    font-size: 18px; color: rgba(255,255,255,.85); text-shadow: 0 1px 3px rgba(0,0,0,.5);
    opacity: 0; transition: opacity .2s; pointer-events: none;
}
.cmd-photo-zoom:hover::after { opacity: 1; }
.cmd-photo-zoom:hover .cmd-photo { transform: scale(1.04); filter: drop-shadow(0 8px 16px rgba(0,0,0,.25)) drop-shadow(0 2px 5px rgba(0,0,0,.14)) brightness(.92) !important; }
@keyframes cmd-fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cmd-no-photo {
    width: 100%; min-height: 180px; display: flex; align-items: center;
    justify-content: center; font-size: 52px; color: #ccc;
    background: #f5f5f5; border-radius: 10px;
}
.cmd-tags-photo { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.cmd-tag {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    background: #e8f4fd; color: #0077cc; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px;
}
.cmd-card-info-col {
    flex: 1 1 66%; min-width: 0; display: flex;
    flex-direction: column; align-self: stretch; background: transparent;
}
.cmd-card-name {
    font-size: 22px; font-weight: 700; color: #1a72d5; text-align: center;
    margin: 16px 20px 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;
    display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.cmd-card-name--invalid { color: #d63638; }
.cmd-card-name--invalid .cmd-pseudo { color: #e08a8b; }
.cmd-pseudo { font-size: 14px; font-weight: 400; color: #888; font-style: italic; }

.cmd-tabs { flex: 1; display: flex; flex-direction: column; margin: 0; padding: 0; border: 0; }
.cmd-tab-nav {
    display: flex; flex-wrap: wrap; gap: 2px;
    padding: 12px 20px 0; margin: 0;
    background: transparent; list-style: none; border: none;
}
.cmd-tab-nav .cmd-tab-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
    font-size: 13px; font-family: inherit; font-weight: 600; line-height: 1.4;
    cursor: pointer; background: #f6f6f6; border: 1px solid #dee2e6;
    border-bottom: none; border-radius: 5px 5px 0 0; color: #54595F;
    transition: background .15s, color .15s; user-select: none;
    white-space: nowrap; outline: none; -webkit-appearance: none; appearance: none;
}
.cmd-tab-nav .cmd-tab-btn:hover { background: #ebebeb; }
.cmd-tab-nav .cmd-tab-btn i { color: #1E73BE; transition: color .15s; }
.cmd-tab-nav .cmd-tab-btn:focus-visible { outline: 2px solid #54595F; outline-offset: -2px; }
.cmd-tab-nav .cmd-tab-btn.active,
.cmd-fiche .cmd-tab-nav .cmd-tab-btn.active,
.cmd-directory .cmd-tab-nav .cmd-tab-btn.active {
    background: #1E73BE !important;
    color: #fff !important;
    border-color: #1E73BE !important;
    font-weight: 700;
}
.cmd-tab-nav .cmd-tab-btn.active i,
.cmd-fiche .cmd-tab-nav .cmd-tab-btn.active i,
.cmd-directory .cmd-tab-nav .cmd-tab-btn.active i { color: #fff !important; }
.cmd-tab-content-wrapper {
    flex: 1; background: #fff; border: 1px solid #dee2e6;
    border-radius: 0 4px 4px 4px; margin: 0 20px 16px;
}
.cmd-fiche .cmd-tab-pane {
    display: none !important; padding: 0 !important; margin: 0 !important;
    height: 0 !important; overflow: hidden !important; visibility: hidden !important;
}
.cmd-fiche .cmd-tab-pane.cmd-tab-active {
    display: block !important; padding: 16px 20px !important; margin: 0 !important;
    height: auto !important; overflow: visible !important; visibility: visible !important;
    color: #54595F; animation: cmd-fadeIn .2s ease;
}
.cmd-info-list {
    list-style: none; margin: 0; padding-left: 0;
    font-size: 14px; color: #54595F; line-height: 1.75;
}
.cmd-info-list > li {
    padding-left: 14px;
    position: relative;
}
.cmd-info-list > li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: #ccc;
    font-weight: 400;
}
.cmd-info-list li { margin-bottom: 6px; padding-bottom: 4px; }
.cmd-info-list li strong { display: block; font-weight: 700; font-size: 13px; color: #54595F; margin-bottom: 1px; }
.cmd-info-list a { color: #0077cc; text-decoration: none; }
.cmd-info-list a:hover { text-decoration: underline; }

/* ── Indicateur ancienneté de la fiche ──────────────────── */
.cmd-maj-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}
.cmd-maj-ok   { background: #e6f9f0; color: #1a7a48; }
.cmd-maj-warn { background: #fff4e0; color: #b35c00; }
.cmd-maj-old  { background: #fdecea; color: #b71c1c; }
.cmd-no-results { text-align: center; color: #888; font-style: italic; padding: 32px 0; }

.cmd-directory.cmd-cols-1 { display: flex; flex-direction: column; gap: 10px; }
.cmd-directory.cmd-cols-2,
.cmd-directory.cmd-cols-3,
.cmd-directory.cmd-cols-4 { display: grid; gap: 10px; }
.cmd-directory.cmd-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cmd-directory.cmd-cols-3 { grid-template-columns: repeat(3, 1fr); }
.cmd-directory.cmd-cols-4 { grid-template-columns: repeat(4, 1fr); }
.cmd-cols-2 .cmd-card-inner,
.cmd-cols-3 .cmd-card-inner,
.cmd-cols-4 .cmd-card-inner { flex-direction: column; align-items: stretch; }
.cmd-cols-2 .cmd-card-photo-col,
.cmd-cols-3 .cmd-card-photo-col,
.cmd-cols-4 .cmd-card-photo-col {
    flex: none; max-width: 100%; border-right: none;
    border-bottom: 1px solid #dee2e6; max-height: 220px; overflow: hidden;
}

.cmd-pagination {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center; margin-top: 32px; padding-bottom: 16px;
}
.cmd-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px;
    border-radius: 8px; background: #f0f0f0; color: #333;
    font-size: 14px; font-weight: 500; text-decoration: none;
    transition: background .15s, color .15s; border: 1px solid #dee2e6;
}
.cmd-page-btn:hover { background: #54595F; color: #fff; text-decoration: none; }
.cmd-page-btn.active { background: #1E73BE; color: #fff; border-color: #1E73BE; pointer-events: none; }
.cmd-page-ellipsis {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; color: #888; font-size: 14px; pointer-events: none;
}

#cmd-zoom-dialog {
    border: none; border-radius: 10px; padding: 0; background: #111;
    max-width: min(90vw, 860px); max-height: 90vh; overflow: hidden;
    box-shadow: 0 16px 60px rgba(0,0,0,.7); position: fixed;
}
#cmd-zoom-dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(3px); }
.cmd-zoom-img {
    display: block; max-width: min(90vw, 860px); max-height: 90vh;
    width: auto; height: auto; object-fit: contain;
}
.cmd-zoom-close {
    position: absolute; top: 8px; right: 10px; font-size: 18px; line-height: 1;
    border: none; background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
    border-radius: 50%; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    z-index: 2; transition: background .15s;
}
.cmd-zoom-close:hover { background: rgba(0,0,0,.85); }

@media (max-width: 1024px) {
    .cmd-directory.cmd-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .cmd-directory.cmd-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .cmd-tab-nav { padding: 8px 12px 0; gap: 4px; }
    .cmd-tab-nav .cmd-tab-btn { font-size: 12px; padding: 6px 10px; }
    .cmd-card-inner { flex-direction: column; align-items: stretch; }
    .cmd-card-photo-col { flex: none; max-width: 100%; border-right: none; border-bottom: 1px solid #dee2e6; align-self: auto; }
    .cmd-card-photo img.cmd-photo { max-height: 260px; object-fit: cover; }
    .cmd-card-info-col { align-self: auto; }
    /* Sur tablette : 2 blocs max par ligne */
    .cmd-panel-fg { flex: 1 1 45%; }
    .cmd-panel-fg--wide { flex: 1 1 100%; }
}
@media (max-width: 600px) {
    .cmd-directory.cmd-cols-2,
    .cmd-directory.cmd-cols-3,
    .cmd-directory.cmd-cols-4 { grid-template-columns: 1fr; }
    /* Sur mobile : empilés, séparateurs horizontaux */
    .cmd-panel-fg { flex: 1 1 100%; min-width: 100%; padding: 10px 8px; align-items: flex-start; text-align: left; border-top: 1px solid #e5e7eb; }
    .cmd-panel-fg + .cmd-panel-fg::before { display: none; }
    .cmd-panel-fg:first-child { border-top: none; }
    .cmd-panel-fg:not(.cmd-panel-fg--wide) .cmd-fg-label { justify-content: flex-start; }
    .cmd-panel-fg:not(.cmd-panel-fg--wide) .cmd-checkbox-group,
    .cmd-panel-fg:not(.cmd-panel-fg--wide) .cmd-radio-group { justify-content: flex-start; }
}

/* ══════════════════════════════════════════════════════════
   Tags visuels — champs à valeurs fixes dans les fiches
   ══════════════════════════════════════════════════════════ */

.cmd-li-tags {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.cmd-li-tags strong {
    display: block;
}

.cmd-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.cmd-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    background: var(--cmd-accent, #2c3e50);
    color: #fff;
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 600px) {
    .cmd-tag {
        white-space: normal;
        word-break: break-word;
        font-size: 10.5px;
        padding: 3px 8px;
    }
    .cmd-tags-wrap {
        max-width: 100%;
    }
}

/* Valeur inconnue / non reconnue → rouge */
.cmd-tag--unknown {
    background: #c0392b;
    color: #fff;
    cursor: help;
}

/* Texte libre (emplacements tatouages, etc.) → neutre, italique */
.cmd-tag--freetext {
    background: var(--cmd-surface, #f0f0f0);
    color: var(--cmd-text, #333);
    font-style: italic;
    font-weight: 400;
    white-space: normal;
}

/* ── Admin : correction inline des tags inconnus ────────── */

/* Hint "cliquer pour corriger" à côté du label */
.cmd-tag-admin-hint {
    font-size: 10px;
    font-weight: 400;
    color: #c0392b;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 6px;
    opacity: .8;
}

/* Tag rouge cliquable */
.cmd-tag--fixable {
    cursor: pointer;
}
.cmd-tag--fixable:hover {
    opacity: .85;
}
.cmd-tag--known::after {
    content: ' ✎';
    font-size: .75em;
    opacity: 0;
    transition: opacity .15s;
}
.cmd-tag--known:hover::after {
    opacity: .6;
}

/* ── Chips mono-valeur (réseau de contact privilégié) ────── */

.cmd-tag-item {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    border: none;
    font-family: inherit;
    cursor: default;
}
.cmd-tag-item--valid {
    background: var(--cmd-accent, #2c3e50);
    color: #fff;
}
.cmd-tag-item--unknown {
    background: #c0392b;
    color: #fff;
}
button.cmd-tag-item {
    cursor: pointer;
}
button.cmd-tag-item:hover {
    opacity: .85;
}

/* Panneau d'options déroulant (chips mono-valeur) */
.cmd-tag-options {
    display: none;
    position: absolute;
    z-index: 999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.14);
    padding: 4px;
    min-width: 200px;
}
.cmd-tags-wrap {
    position: relative;
}
.cmd-tag-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border: none;
    background: none;
    border-radius: 5px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    color: var(--cmd-text, #333);
}
.cmd-tag-opt:hover {
    background: var(--cmd-surface, #f0f0f0);
}
.cmd-tag-opt--current {
    font-weight: 600;
    color: var(--cmd-accent, #2c3e50);
}
.cmd-tag-opt--delete {
    color: #c0392b;
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 8px;
}

/* Modale de correction — overlay centré */
#cmd-fix-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.45);
    align-items: center;
    justify-content: center;
}
#cmd-fix-modal.cmd-modal--open {
    display: flex;
}
.cmd-fix-modal-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,.28);
    padding: 20px 24px 16px;
    min-width: 260px;
    max-width: min(340px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cmd-fix-modal-title {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin: 0 0 2px;
}
.cmd-fix-modal-field {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 6px;
}
.cmd-fix-modal-opts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 60vh;
    overflow-y: auto;
}
.cmd-fix-modal-opt {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1.5px solid #e2e4e7;
    background: #f9f9f9;
    font-size: 13px;
    color: #2c3e50;
    cursor: pointer;
    text-align: left;
    transition: background .1s, border-color .1s;
}
.cmd-fix-modal-opt:hover {
    background: #f0f6fc;
    border-color: #2271b1;
    color: #2271b1;
}
.cmd-fix-modal-opt--delete {
    color: #c0392b;
    border-color: #f5c6cb;
    background: #fff5f5;
}
.cmd-fix-modal-opt--delete:hover {
    background: #fde8e8;
    border-color: #c0392b;
}
.cmd-fix-modal-cancel {
    margin-top: 4px;
    padding: 6px;
    font-size: 12px;
    color: #787c82;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
}
.cmd-fix-modal-cancel:hover { color: #1d2327; }

/* États pendant / après sauvegarde */
.cmd-tag--saving {
    opacity: .5;
    pointer-events: none;
}
.cmd-tag--error {
    background: #7f1d1d !important;
    outline: 2px solid #ef4444;
}
.cmd-tag--just-fixed {
    background: #16a34a !important;
    transition: background 1.5s ease;
}
.cmd-tag--just-fixed {
    background: var(--cmd-accent, #2c3e50) !important;
}

/* ── Bouton édition admin — angle haut/droite de chaque fiche ── */
.cmd-fiche { position: relative; }
.cmd-fiche .cmd-card-photo,
.cmd-fiche .cmd-photo-zoom,
.cmd-fiche .cmd-card-photo img.cmd-photo { width: 260px; height: 260px; }
.cmd-fiche-edit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    color: #555;
    border: 1px solid rgba(0,0,0,.08);
    text-decoration: none;
    opacity: 0;
    transition: opacity .15s, background .15s, color .15s;
    backdrop-filter: blur(2px);
}
.cmd-fiche:hover .cmd-fiche-edit-btn { opacity: 1; }
.cmd-fiche-edit-btn:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ── Bouton + ajout de tag (front admin) ── */
.cmd-tag-add-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}
.cmd-tag-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px dashed #6b7280;
    background: transparent;
    color: #6b7280;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: border-color .12s, color .12s, background .12s;
}
.cmd-tag-add-btn:hover {
    border-color: var(--cmd-accent, #2c3e50);
    color: var(--cmd-accent, #2c3e50);
    background: rgba(44,62,80,.07);
}
.cmd-tag-add-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cmd-tag-add-input {
    height: 26px;
    border: 1.5px solid var(--cmd-accent, #2c3e50);
    border-radius: 13px;
    padding: 0 10px;
    font-size: 12px;
    outline: none;
    width: 150px;
    background: #fff;
    color: #1d2327;
    box-sizing: border-box;
}
.cmd-tag-add-input:focus {
    box-shadow: 0 0 0 2px rgba(44,62,80,.2);
}
.cmd-tag-add-confirm,
.cmd-tag-add-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.cmd-tag-add-confirm {
    border-color: var(--cmd-accent, #2c3e50);
    background: var(--cmd-accent, #2c3e50);
    color: #fff;
}
.cmd-tag-add-cancel {
    border-color: #9ca3af;
    background: #f3f4f6;
    color: #6b7280;
}
.cmd-tag-add-cancel:hover { border-color: #d63638; color: #d63638; }

/* ── Bouton admin "fiches sans valeur valide" ──────────────── */
.cmd-admin-missing-btn {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    margin-top: .5rem;
    padding: .25em .7em;
    font-size: .75rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: 1px dashed #f59e0b;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.cmd-admin-missing-btn:hover {
    background: #fde68a;
    border-color: #d97706;
    color: #78350f;
}
.cmd-admin-missing-btn.active {
    background: #fde68a;
    border-color: #b45309;
    color: #78350f;
    font-style: italic;
}

/* ── Liens sociaux sous la photo de fiche ────────────────── */
.cmd-photo-with-social {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.cmd-social-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.cmd-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    transition: transform .15s, background .15s;
    text-decoration: none !important;
}
.cmd-social-link--active {
    color: #1E73BE;
    background: #e8f3fc;
}
.cmd-social-link--active:hover {
    background: #1E73BE;
    color: #fff;
    transform: scale(1.1);
}
.cmd-social-link--disabled {
    color: #ccc;
    background: #f5f5f5;
    cursor: default;
}
/* Réseau privilégié : étoile + anneau coloré */
.cmd-social-link--pref {
    background: #1E73BE;
    color: #fff;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1E73BE;
    position: relative;
}
.cmd-social-link--pref::after {
    content: '★';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 9px;
    line-height: 1;
    color: #1E73BE;
    background: #fff;
    border-radius: 50%;
    width: 13px;
    height: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.cmd-social-link--pref:hover {
    background: #155d9e;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #155d9e;
    transform: scale(1.12);
}
