/* مكوّن موحّد: اختيار فروع (قائمة منسدلة + تحديد + بحث) */
.bfp-wrap {
    position: relative;
    width: 100%;
}
.bfp-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bfp-toggle:hover,
.bfp-toggle:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}
.bfp-label-text {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
    font-weight: 600;
}
.bfp-caret {
    flex-shrink: 0;
    color: #9333ea;
    font-size: 0.75rem;
    transition: transform 0.2s;
}
.bfp-wrap.is-open .bfp-caret {
    transform: rotate(-180deg);
}
.bfp-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 100;
    flex-direction: column;
    background: #fff;
    border: 2px solid #9333ea;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 0.65rem;
    max-height: min(58vh, 420px);
    box-sizing: border-box;
}
.bfp-panel.is-open {
    display: flex;
}
.bfp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.bfp-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}
.bfp-search:focus {
    outline: none;
    border-color: #9333ea;
}
.bfp-list {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.35rem;
    max-height: min(40vh, 300px);
    overflow-y: auto;
    background: #fafafa;
    scrollbar-gutter: stable;
}
.bfp-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.4rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
    text-align: right;
    direction: rtl;
    margin: 0;
    box-sizing: border-box;
}
.bfp-row:last-child {
    border-bottom: none;
}
.bfp-row:hover {
    background: #f0f9ff;
}
.bfp-row input {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    cursor: pointer;
}
.bfp-name {
    flex: 1;
    min-width: 0;
}
.filter-group .bfp-wrap {
    min-width: 12rem;
}
