/* ===================================================================
   Filter Panel — Minimal, smooth UI matching Dashboard / PS pages
   =================================================================== */

/* ---- Panel Container ---- */
.filter-panel {
    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.filter-panel:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ---- Header ---- */
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #eef1f5;
    background: #fafbfd;
}

.filter-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1E2A3A;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.filter-panel-title i {
    color: #0077B6;
    font-size: 0.8rem;
}

.filter-reset-link {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.filter-reset-link:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ---- Body ---- */
.filter-panel-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---- Divider ---- */
.filter-divider {
    border: none;
    height: 1px;
    background: #eef1f5;
    margin: 2px 0;
}

/* ---- Field ---- */
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---- Search Input ---- */
.filter-search-wrap {
    position: relative;
}

.filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.75rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.filter-search-wrap .filter-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #1E2A3A;
    background: #ffffff;
    transition: all 0.2s ease;
    outline: none;
}

.filter-search-wrap .filter-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.filter-search-wrap .filter-input:focus {
    border-color: #0077B6;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.08);
}

.filter-search-wrap .filter-input:focus + .filter-search-icon,
.filter-search-wrap:focus-within .filter-search-icon {
    color: #0077B6;
}

/* ---- Select Dropdown ---- */
.filter-select-wrap {
    position: relative;
}

.filter-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #94a3b8;
    pointer-events: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.filter-select-wrap:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
    border-top-color: #0077B6;
}

.filter-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 30px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #1E2A3A;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.filter-select:focus {
    border-color: #0077B6;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.08);
}

.filter-select:hover:not(:focus) {
    border-color: #cbd5e1;
}

.filter-select.has-selection {
    border-color: #0077B6;
    color: #0077B6;
    font-weight: 500;
}

/* ---- Toggle Row ---- */
.filter-toggle-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.filter-toggle-item .filter-field-label {
    text-transform: none;
    font-size: 0.8125rem;
    color: #475569;
    margin: 0;
}

.toggle-status {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 2px;
}

/* Mini Toggle Switch */
.mini-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.mini-toggle .toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.mini-toggle-track {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    border-radius: 20px;
    transition: background 0.25s ease;
}

.mini-toggle-track::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-toggle .toggle-input:checked + .mini-toggle-track {
    background: #0077B6;
}

.mini-toggle .toggle-input:checked + .mini-toggle-track::before {
    transform: translateX(16px);
}

.mini-toggle .toggle-input:focus-visible + .mini-toggle-track {
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

/* ---- Chip Group (Positions) ---- */
.filter-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    cursor: pointer;
    margin: 0;
}

.filter-chip .position-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-chip-text {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    background: #ffffff;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-chip:hover .filter-chip-text {
    border-color: #cbd5e1;
    color: #475569;
}

.filter-chip .position-radio:checked + .filter-chip-text {
    background: #f0f7ff;
    border-color: #0077B6;
    color: #0077B6;
    font-weight: 600;
}

/* ---- Apply Button ---- */
.filter-apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 4px;
    background: #0077B6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.filter-apply-btn:hover {
    background: #005f8f;
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.25);
}

.filter-apply-btn:active {
    transform: scale(0.98);
}

.filter-apply-btn i {
    font-size: 0.7rem;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .filter-panel {
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #e8ecf1;
    }
}
