/* Include/Exclude filter component (cfd-*) – shared across Dashboard, Winning Products, Lotgenoten */

.cfd-container { position: relative; width: 100%; min-width: 270px; }
.cfd-trigger {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    min-height: 33px; padding: 4px 28px 4px 7px;
    border: 1px solid #e9e9e9 !important;
    border-radius: 11px !important;
    box-shadow: 0 0px 0px 0 rgb(0 0 0 / 10%), 0 1px 2px -1px rgb(0 0 0 / 10%);
    cursor: pointer; background: #fff !important;
    color: #555; font-size: 13px; font-weight: 400;
    -webkit-appearance: none; appearance: none;
    position: relative;
}
.cfd-trigger::before {
    content: '';
    position: absolute;
    right: 10px;
    top: 8px;
    width: 12px;
    height: 12px;
    border: 3px solid #225AEA;
    border-top: 3px solid #fff;
    border-right: 3px solid #fff;
    transform: rotate(-45deg);
    transition: 0.5s;
    background-color: #fff;
    border-radius: 30%;
    pointer-events: none;
}
.cfd-container.open .cfd-trigger::before {
    transform: rotate(-225deg);
    top: 12px;
}
.cfd-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 6px; border-radius: 4px;
    height: 23px !important; line-height: 23px !important; margin-top: 2px !important;
    font-size: 12px; font-weight: 400; white-space: nowrap;
    border: none !important;
}
.cfd-tag-include { background: #dcfce7; color: #166534; }
.cfd-tag-blue { background: #dbeafe; color: #1e40af; }
.cfd-tag-exclude { background: #fee2e2; color: #991b1b; }
.cfd-tag-more { background: #f1f5f9; color: #64748b; cursor: default; }
.cfd-tag img { width: 14px; height: 10px; border-radius: 1px; object-fit: cover; }
.cfd-tag-remove { cursor: pointer; font-size: 13px; line-height: 1; color: #6451ff !important; margin-left: 1px; }
.cfd-tag-remove:hover { opacity: 0.9; }
.cfd-search-input {
    border: none; outline: none; flex: 1; min-width: 60px;
    font-size: 13px !important; color: #555 !important; background: transparent;
    padding: 0; height: 23px; margin-top: 2px;
}
.cfd-panel {
    display: none; position: absolute; top: calc(100% + 3px); left: 0; right: 0;
    min-width: 280px; width: max-content; max-width: 360px;
    background: #fff; border: 1px solid #e9e9e9;
    border-radius: 6px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px -1px rgb(0 0 0 / 10%);
    z-index: 1000;
    max-height: 260px; overflow-y: auto; overflow-x: hidden;
}
.cfd-panel.open { display: block; }
.cfd-item {
    display: flex; align-items: center; padding: 5px 8px; gap: 6px;
    font-size: 12px; transition: background .1s; user-select: none;
}
.cfd-item:hover { background: #f8fafc; }
.cfd-item.cfd-included { background: #f0fdf4; }
.cfd-item.cfd-excluded { background: #fef2f2; }
.cfd-item-flag { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.cfd-item-name { flex: 1; }
.cfd-item-actions { display: flex; gap: 3px; }
.cfd-btn {
    width: 22px; height: 22px; border: 1px solid #e2e8f0; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1;
    background: #fff; transition: all .12s; color: #94a3b8;
}
.cfd-btn:hover { transform: scale(1.1); }
.cfd-btn-inc:hover, .cfd-btn-inc.active { background: #dcfce7; border-color: #86efac; color: #16a34a; }
.cfd-btn-exc:hover, .cfd-btn-exc.active { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.cfd-empty { padding: 12px; text-align: center; color: #94a3b8; font-size: 12px; }
.cfd-toolbar {
    display: flex; gap: 4px; padding: 5px 8px;
    border-bottom: 1px solid #f1f5f9; position: sticky; top: 0; background: #fff; z-index: 1;
}
.cfd-bulk {
    flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid #e2e8f0; border-radius: 4px;
    font-size: 11px; font-weight: 600; cursor: pointer; background: #fff;
    color: #64748b; transition: all .12s; line-height: 1.3; white-space: nowrap;
}
.cfd-bulk:hover { background: #f8fafc; }
.cfd-bulk-inc:hover { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.cfd-bulk-exc:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.cfd-bulk-clear:hover { background: #f8fafc; border-color: #cbd5e1; color: #334155; }

/* Meta ads niche v3 — trigger matches filter row; dropdown = dark 3-column panels */
.n3-root { position: relative; width: 100%; min-width: 0; }
.n3-trigger {
    display: flex; align-items: center; gap: 8px;
    width: 100%; min-height: 33px; padding: 4px 10px 4px 8px;
    border: 1px solid #e9e9e9 !important; border-radius: 11px !important;
    box-shadow: 0 0px 0px 0 rgb(0 0 0 / 10%), 0 1px 2px -1px rgb(0 0 0 / 10%);
    cursor: pointer; background: #fff !important; color: #555 !important;
    font-size: 13px; font-weight: 400; text-align: left;
    -webkit-appearance: none; appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.n3-trigger:hover { border-color: #d0d0d0 !important; }
.n3-trigger-icon { flex-shrink: 0; color: #64748b !important; }
.n3-trigger-label { flex: 1; min-width: 0; font-size: 13px; color: #555; }
.n3-trigger-count { flex-shrink: 0; font-size: 12px; font-weight: 500; color: #2563eb; }
.n3-count-exc { color: #ef4444 !important; }
.n3-chevron { flex-shrink: 0; color: #94a3b8; transition: transform 0.2s ease; }
.n3-root.n3-open .n3-chevron { transform: rotate(180deg); }

.n3-dropdown {
    position: fixed; z-index: 10050; display: flex; align-items: flex-start; gap: 0;
    max-width: calc(100vw - 16px);
}
.n3-dropdown.hidden { display: none !important; }

.n3-panel { width: 208px; margin-left: 4px; flex-shrink: 0; }
.n3-panel:first-child { margin-left: 0; }
.n3-panel-inner {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    max-height: 300px;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.n3-list {
    overflow-y: auto; padding: 2px; flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.n3-item {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 6px; border-radius: 4px; cursor: pointer;
    transition: background 0.1s ease; user-select: none;
}
.n3-item:hover { background: rgba(255, 255, 255, 0.04); }
.n3-item.active { background: rgba(59, 130, 246, 0.1); }
.n3-item.excluded-active { background: rgba(239, 68, 68, 0.08); }
.n3-item-check {
    width: 10px; height: 10px; border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.1s ease;
}
.n3-item-check.checked,
.n3-item-check.partial { background: #3b82f6; border-color: #3b82f6; }
.n3-item-check.excluded,
.n3-item-check.partial-excluded { background: #ef4444; border-color: #ef4444; }
.n3-item-check.partial-excluded { background: rgba(239, 68, 68, 0.45); }
.n3-item-name {
    flex: 1; font-size: 12px; font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.n3-item.active .n3-item-name { color: #fff; }
.n3-item.excluded-active .n3-item-name { color: #fca5a5; }
.n3-item-name-stack { white-space: normal; display: flex; flex-direction: column; gap: 1px; }
.n3-item-path { font-size: 9px; color: rgba(255, 255, 255, 0.35); line-height: 1.2; }
.n3-item-arrow {
    width: 12px; height: 12px; display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.25); flex-shrink: 0;
}
.n3-item:hover .n3-item-arrow { color: rgba(255, 255, 255, 0.5); }
.n3-empty {
    padding: 20px 10px; text-align: center; color: rgba(255, 255, 255, 0.35); font-size: 12px;
}

.n3-search-wrap { padding: 6px; flex-shrink: 0; }
.n3-search-box {
    display: flex; align-items: center; gap: 6px;
    padding: 0 8px; border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.n3-search-box svg { flex-shrink: 0; color: rgba(255, 255, 255, 0.25); }
.n3-search-input {
    flex: 1; width: 100%; padding: 5px 0; font-size: 12px; color: #fff;
    background: transparent; border: none; outline: none;
}
.n3-search-input::placeholder { color: rgba(255, 255, 255, 0.25); }

.n3-mode-wrap { display: flex; gap: 3px; padding: 0 6px 6px; flex-shrink: 0; }
.n3-mode-btn {
    flex: 1; padding: 4px 0; font-size: 10px; font-weight: 600;
    border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent; color: rgba(255, 255, 255, 0.35);
    cursor: pointer; transition: all 0.15s ease;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.n3-mode-btn:hover { color: rgba(255, 255, 255, 0.6); border-color: rgba(255, 255, 255, 0.15); }
.n3-mode-btn.active[data-n3-mode="include"] {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: #3b82f6;
}
.n3-mode-btn.active[data-n3-mode="exclude"] {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ef4444;
}
