/* ================================
   CUSTOM SELECT — dropdown con icone
   ================================ */

.custom-select {
    position: relative;
    width: 100%;
}

/* selettori configurazione in cima/dentro alle sezioni bal_* — stesso max-width
   che aveva il <select> nativo prima di essere sostituito da CustomSelect */
.filter-section .custom-select {
    max-width: 300px;
}

.custom-select-selected {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-height: 40px;
    font-size: 15px;
}

.custom-select-selected:hover {
    border-color: #9ca3af;
}

.custom-select-selected:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.selected-icon,
.option-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

.select-arrow {
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.2s;
}

.custom-select-options {
    /* position e coordinate impostati inline via getBoundingClientRect() */
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 25000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.custom-select-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.custom-select-option:hover {
    background-color: #f8fafc;
}

.custom-select-option.selected {
    background-color: #fef2f2;
    color: #dc2626;
}

.custom-select-option span,
.custom-select-selected span {
    flex: 1;
    min-width: 0; /* permette al testo di troncare invece di forzare la larghezza del flex item */
}

.custom-select-option small,
.custom-select-selected small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
