/* ============================================================
   custom-select.css — кастомный dropdown со скруглениями
   ============================================================ */

.custom-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: auto;
    min-width: 150px;
    padding: 9px 32px 9px 12px;
    background-color: #1a2232;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.custom-select:hover {
    border-color: var(--border-strong);
}
.custom-select:focus,
.custom-select.open {
    background-color: #1f2a3d;
    border-color: var(--accent-30);
    box-shadow: 0 0 0 2px var(--accent-20);
}

/* Стрелка */
.custom-select::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7282' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
    pointer-events: none;
    transition: transform .15s;
}
.custom-select.open::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-display {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Выпадающий список — со скруглениями */
.custom-select-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    background-color: #1a2232;
    border: 1px solid var(--border-strong);
    border-radius: 10px;                  /* ← скругление как у select */
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .65);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.custom-select.open .custom-select-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-select-list.open-up {
    top: auto;
    bottom: calc(100% + 4px);
    transform: translateY(4px);
}
.custom-select.open .custom-select-list.open-up {
    transform: translateY(0);
}

/* Опции */
.custom-select-option {
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    transition: background-color .1s, color .1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-select-option:hover,
.custom-select-option.focused {
    background-color: rgba(51, 148, 230, .15);
    color: var(--accent);
}
.custom-select-option.selected {
    background-color: rgba(51, 148, 230, .20);
    color: var(--accent);
    font-weight: 500;
}
.custom-select-option.disabled {
    opacity: .45;
    cursor: not-allowed;
    background: transparent;
    color: var(--text-mute);
}
.custom-select-option.disabled:hover {
    background: transparent;
    color: var(--text-mute);
}

/* Скроллбар */
.custom-select-list::-webkit-scrollbar { width: 8px; }
.custom-select-list::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

/* Светлая тема */
html[data-theme='light'] .custom-select {
    background-color: #f3f4f6;
    color: #101828;
}
html[data-theme='light'] .custom-select:focus,
html[data-theme='light'] .custom-select.open {
    background-color: #eff6ff;
    border-color: var(--accent-30);
}
html[data-theme='light'] .custom-select::after {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5565' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
html[data-theme='light'] .custom-select-list {
    background-color: #ffffff;
    border-color: #d1d5dc;
    box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .35);
}
html[data-theme='light'] .custom-select-option {
    color: #101828;
}
html[data-theme='light'] .custom-select-option:hover,
html[data-theme='light'] .custom-select-option.focused {
    background-color: #eff6ff;
    color: #1d4ed8;
}
html[data-theme='light'] .custom-select-option.selected {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* Disabled */
.custom-select.disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Мобильные */
@media (max-width: 640px) {
    .custom-select-list {
        max-height: 200px;
        border-radius: 8px;
    }
}
/* ============================================================
   Контекстные правила (installer38f)
   — В фильтрах: auto, чтобы вставали в одну строку
   — В формах: 100%, чтобы растягивались
   ============================================================ */

/* Фильтры (users, topics) — все в одну строку */
.admin-filters-row .custom-select {
    width: auto;
    flex: 0 1 auto;
    min-width: 150px;
}
.admin-filters-row .admin-filters-search {
    flex: 1 1 260px;
    min-width: 180px;
}

/* В формах — на всю ширину поля */
.admin-form .custom-select,
.admin-topic-move-form .custom-select,
.topic-move-form .custom-select {
    width: 100%;
    min-width: 0;
}

/* Мобильные: в фильтрах — на всю ширину */
@media (max-width: 640px) {
    .admin-filters-row .custom-select {
        width: 100%;
        flex: 1 1 100%;
    }
}