/* =============================================================/* ── TAG FILTER DROPDOWN ── */
.tag-filter-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
}

.tag-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tag-filter-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.tag-filter-btn.menu-open {
    border-color: #2b5797;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(43, 87, 151, 0.1);
}

.tag-filter-icon {
    display: flex;
    align-items: center;
    color: #2b5797; /* Premium InMobility Blue */
}

.tag-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2b5797;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    margin-left: 2px;
}

.tag-filter-count:empty,
.tag-filter-count[data-count="0"] {
    display: none;
}

.tag-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 260px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: tw-fade-in 0.2s ease-out;
}

@keyframes tw-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tag-filter-menu.active {
    display: flex;
}

.tag-filter-search {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-filter-search i {
    color: #94a3b8;
    font-size: 14px;
}

.tag-filter-search input {
    border: none;
    outline: none;
    font-size: 13px;
    width: 100%;
    color: #1e293b;
    background: transparent;
}

.tag-filter-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px 0;
}

.tag-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tag-filter-item:hover {
    background: #f8fafc;
}

.tag-filter-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #fff;
}

.tag-filter-checkbox i {
    font-size: 10px;
    color: transparent;
    transition: color 0.2s;
}

.tag-filter-item.selected .tag-filter-checkbox {
    background: #2b5797;
    border-color: #2b5797;
}

.tag-filter-item.selected .tag-filter-checkbox i {
    color: #fff;
}

.tag-filter-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-filter-text {
    font-size: 13px;
    color: #475569;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-filter-item.selected .tag-filter-text {
    color: #1e293b;
    font-weight: 600;
}

.tag-filter-footer {
    padding: 10px 12px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.tag-filter-clear,
.tag-filter-apply {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.tag-filter-clear {
    background: transparent;
    color: #64748b;
}

.tag-filter-clear:hover {
    background: #f1f5f9;
    color: #475569;
}

.tag-filter-apply {
    background: #2b5797;
    color: #fff;
    box-shadow: 0 1px 2px rgba(43, 87, 151, 0.2);
}

.tag-filter-no-results {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

/* ─────────────────────────────────────────────────────────────
   Dropdown Global (Common for List Filters)
   Standardise Lead, Account & Contact lists
   ───────────────────────────────────────────────────────────── */

.cd-tab-filter-wrapper.v2-filters-flex-row {
    position: relative !important;
    z-index: 50 !important;
    overflow: visible !important;
}

.v2-header-tag-filter {
    padding: 8px 8px 8px 12px;
    position: relative;
    z-index: 100;
    overflow: visible !important;
}

.v2-filters-flex-row {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    overflow: visible !important;
}

.v2-tag-filter-separator {
    width: 1px;
    height: 32px;
    background: #cbd5e1;
    margin: 0 16px;
    align-self: center;
}

.v2-tag-filter-trigger {
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.v2-tag-filter-trigger:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
}

.v2-tag-filter-trigger.active {
    background: #f8fafc;
    border-color: #2b5797;
    color: #2b5797;
    box-shadow: 0 0 0 3px rgba(43, 87, 151, 0.05);
}

.v2-tag-filter-trigger-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2b5797;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 2px;
}
.v2-tag-filter-menu {
    position: absolute;
    left: 12px;
    top: calc(100% + 5px);
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    z-index: 99999;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
}

.v2-tag-filter-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
}

.v2-tag-filter-item:last-child {
    border-bottom: none;
}

.v2-tag-filter-item:hover {
    background: #f8fafc;
}

.v2-tag-filter-item.active {
    background: #f8fafc;
    font-weight: 600;
}

.v2-tag-filter-dot {
    min-width: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.v2-tag-filter-check {
    margin-left: auto;
    color: #2b5797;
    display: none;
}

.v2-tag-filter-item.active .v2-tag-filter-check {
    display: block;
}

.v2-tag-chevron {
    min-width: 12px;
}

.v2-tag-filter-dot--all {
    border: 1px solid #cbd5e1;
    background: transparent;
}

.v2-tag-filter-check--visible {
    display: block;
}
/* =============================================================
   tag-widget.css — Styles du système de tags global InMobility
   V2 — Full-color pills, uppercase, oval remove button
   ============================================================= */

/* ── Zone principale ── */
.tw-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 0 2px 0;
    min-height: 24px;
    position: relative;
}

/* ── Section dans la fiche (fond blanc arrondi) ── */
.tag-widget-section {
    padding: 4px 12px 3px 12px;
    border-bottom: 1px solid #e8edf3;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 6px;
}

/* ── Pills des tags ── */
.tw-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    padding-left: 10px;
    padding-right: 4px;
    border-radius: 999px;
    box-sizing: border-box;
    vertical-align: middle;
    gap: 6px;
    white-space: nowrap;
    max-width: 220px;
    user-select: none;
    cursor: default;
    transition: filter 0.15s ease;
    margin: 0 4px 4px 0;
}

.tw-pill:hover {
    filter: brightness(0.95);
}

.tw-pill.tw-pill-removing {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Libellé du tag */
.tw-pill-label {
    display: inline-flex;
    align-items: center;
    height: 100%;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Bouton de suppression — Petit cercle à droite */
.tw-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    line-height: 1;
    font-size: 11px;
    cursor: pointer;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

/* Thème Sombre (Texte blanc) */
.tw-pill-dark .tw-pill-remove {
    background: rgba(255, 255, 255, 0.20);
}
.tw-pill-dark .tw-pill-remove:hover {
    background: rgba(255, 255, 255, 0.40);
    opacity: 1;
}

/* Thème Clair (Texte noir) */
.tw-pill-light .tw-pill-remove {
    background: rgba(0, 0, 0, 0.10);
}
.tw-pill-light .tw-pill-remove:hover {
    background: rgba(0, 0, 0, 0.20);
    opacity: 1;
}

/* ── Zone input d'ajout ── */
.tw-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tw-input {
    height: 19px;
    border: 1.2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 0 8px;
    font-size: 11px;
    color: #475569;
    background: rgba(248, 250, 252, 0.5);
    width: 90px;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, background 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.tw-input::placeholder {
    color: #94a3b8;
    font-style: italic;
    opacity: 0.7;
}

.tw-input:focus {
    width: 140px;
    border-style: solid;
    border-color: #2b5797;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(43, 87, 151, 0.1);
}

/* ── Dropdown d'autocomplétion ── */
.tw-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    max-width: 260px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
    z-index: 1050;
    overflow: hidden;
    animation: twFadeIn 0.12s ease;
}

@keyframes twFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tw-autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 200px;
    overflow-y: auto;
}

.tw-ac-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 11.5px;
    color: #334155;
    cursor: pointer;
    transition: background 0.1s ease;
}

.tw-ac-item:hover {
    background: #f1f5f9;
    color: #2b5797;
}

/* Point coloré dans l'autocomplete (inchangé) */
.tw-ac-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Option "Créer un tag" */
.tw-autocomplete-create {
    padding: 7px 12px;
    font-size: 11.5px;
    color: #2b5797;
    font-weight: 500;
    cursor: pointer;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    transition: background 0.1s ease;
}

.tw-autocomplete-create:hover {
    background: #e8f0fb;
}

.tw-create-preview {
    font-style: italic;
}

/* ── Sélecteur de couleurs (Création) ── */
.tw-color-picker {
    display: flex;
    gap: 6px;
    padding: 6px 12px 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    justify-content: flex-start;
}

.tw-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1);
    transition: transform 0.15s ease;
}

.tw-color-dot:hover {
    transform: scale(1.15);
}

.tw-color-dot.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #cbd5e1;
}

/* ── Version compacte pour activités ── */
.tag-widget-compact .tw-zone {
    padding: 3px 0 2px 0;
    gap: 4px;
    min-height: 26px;
}

.tag-widget-compact .tw-pill {
    height: 18px;
    font-size: 10px;
    padding: 0 0 0 8px; /* Pas de padding droit */
    border-radius: 9px;
}

.tag-widget-compact .tw-pill-remove {
    height: 18px;
    padding: 0 6px 0 4px;
    border-radius: 0 9px 9px 0;
}

.tag-widget-compact .tw-input {
    height: 18px;
    font-size: 10.5px;
    width: 90px;
    border-radius: 9px;
}

.tag-widget-compact .tw-input:focus {
    width: 130px;
}

/* ── Responsive mobile ── */
@media (max-width: 640px) {
    .tw-zone {
        gap: 5px;
    }

    .tw-input-wrap {
        width: 100%;
    }

    .tw-input {
        width: 100%;
        box-sizing: border-box;
    }

    .tw-input:focus {
        width: 100%;
    }

    .tw-autocomplete {
        min-width: 100%;
        width: 100%;
        left: 0;
        right: 0;
    }

    .tw-pill-label {
        max-width: 110px;
    }
}

/* ── Utilitaires hide ── */
.tw-autocomplete.hide {
    display: none !important;
}

.tw-autocomplete-create.hide {
    display: none !important;
}
