/* Shared search/filter styles for list pages (Applicants, Offers, Meetings, …).
   Markup: .filter-panel > [search row] + .filter-footer (.filter-selects + .filter-summary) */

.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Input with a leading icon (and optional trailing clear button / spinner) */
.filter-field {
    position: relative;
}

.filter-field .form-control {
    padding-left: 2.4rem;
    height: 40px;
}

.filter-field .filter-search {
    padding-right: 2.4rem;
}

.filter-panel .filter-field .form-control {
    height: 44px;
}

.filter-panel .filter-field .filter-search {
    font-size: 1rem;
}

.filter-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8b85a8;
    pointer-events: none;
    z-index: 1;
}

.filter-field:focus-within .filter-icon {
    color: var(--lila);
}

.filter-trailing {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.filter-clear-input {
    border: 0;
    background: none;
    padding: 0;
    line-height: 1;
    color: #b3aecb;
    cursor: pointer;
}

.filter-clear-input:hover,
.filter-clear-input:focus-visible {
    color: var(--lila);
}

/* Hide the browser's own clear "x" on type="search" — we render our own */
.filter-search::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Bottom bar: dropdown filters on the left, result count + reset on the right */
.filter-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(103, 56, 220, 0.08);
}

.filter-selects {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-selects .form-select {
    width: auto;
    min-width: 160px;
    max-width: 240px;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8b85a8;
    margin-right: 0.25rem;
}

.filter-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.filter-reset {
    color: var(--lila);
    text-decoration: none;
    font-weight: 500;
    padding-left: 0;
    padding-right: 0;
}

.filter-reset:disabled {
    color: #b3aecb;
}

/* A filter that is in use gets a tinted background so it's easy to spot */
.filter-active {
    background-color: rgba(103, 56, 220, 0.06) !important;
    border-color: var(--lila) !important;
}

/* From–to date range that looks like one small form field */
.filter-date-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    white-space: nowrap;
}

.filter-date-range .bi {
    color: #8b85a8;
    font-size: 14px;
}

.filter-date-range input[type="date"] {
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    width: 7.6rem;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
}

.filter-date-range:focus-within {
    border-color: var(--lila) !important;
    box-shadow: 0 0 0 0.25rem rgba(103, 56, 220, 0.15) !important;
}

.filter-date-range-sep {
    color: #8b85a8;
}

@media (max-width: 575.98px) {
    .filter-selects .form-select,
    .filter-selects .filter-date-range {
        flex: 1 1 100%;
        max-width: none;
    }

    .filter-label {
        flex-basis: 100%;
    }

    .filter-summary {
        width: 100%;
        justify-content: space-between;
    }
}
