/* Kombiniertes Auswahl-/Suchfeld (resources/combobox.js) und Drei-Zustands-Filter
   (resources/tristate_filter.js). Ueber top_include.php auf jeder Seite. */

.rm-combobox {
    position: relative;
}

/* Das echte <select> bleibt Formularfeld, ist aber nicht mehr zu sehen. */
.rm-combobox-native {
    display: none !important;
}

/* Pfeil wie bei Bootstraps custom-select: sieht aus wie eine Auswahlliste, man kann aber tippen. */
.rm-combobox-input {
    padding-right: 1.75rem;
    background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;
    background-size: 8px 10px;
}

.rm-combobox-input:disabled {
    background-color: #e9ecef;
}

/* Neu anzulegender Eintrag: sichtbar markiert, bis gespeichert ist. */
.rm-combobox-input.rm-combobox-is-new {
    border-color: #28a745;
}

.rm-combobox-menu {
    width: 100%;
    min-width: 12rem;
    max-height: 18rem;
    overflow-y: auto;
    margin-top: .125rem;
}

.rm-combobox-item {
    cursor: pointer;
    white-space: normal;
}

.rm-combobox-item.rm-combobox-current:not(.active) {
    font-weight: 600;
}

.rm-combobox-create {
    color: #28a745;
    font-weight: 600;
}

/* Drei Zustaende einer Filteroption: ✓ nur das, ✕ ohne das. */
.rm-combobox-item.rm-tri-include::before,
.rm-filter-chip.rm-tri-include::before {
    content: '\2713\00a0';
    font-weight: 700;
}

.rm-combobox-item.rm-tri-exclude::before,
.rm-filter-chip.rm-tri-exclude::before {
    content: '\2715\00a0';
    font-weight: 700;
}

.rm-combobox-item.rm-tri-include:not(.active) {
    color: #155724;
    background: #d4edda;
}

.rm-combobox-item.rm-tri-exclude:not(.active) {
    color: #721c24;
    background: #f8d7da;
    text-decoration: line-through;
}

.rm-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: flex-start;
}

.rm-filter-dimension {
    flex: 1 1 11rem;
    min-width: 9rem;
    max-width: 18rem;
}

/* Handy: zwei Filter nebeneinander statt vier volle Zeilen. */
@media (max-width: 575.98px) {
    .rm-filter-dimension {
        flex-basis: calc(50% - .25rem);
        min-width: 0;
        max-width: none;
    }
}

.rm-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .5rem;
}

.rm-filter-chips:empty {
    display: none;
}

.rm-filter-chip {
    border: 1px solid #6c757d;
    border-radius: 10rem;
    padding: .2rem .65rem;
    font-size: .875rem;
    background: #fff;
    line-height: 1.4;
}

.rm-filter-chip.rm-tri-include {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.rm-filter-chip.rm-tri-exclude {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.rm-filter-chip .rm-filter-chip-label {
    opacity: .75;
}
