.sidebar {
    width: 320px;
    background: #e8e8e8;
    border-right: 1px solid #ccc;
    flex-shrink: 0;
    box-sizing: border-box;
    align-self: stretch;
}

.sidebar-inner {
    padding: 12px 12px 14px;
    box-sizing: border-box;
}

.sidebar h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.sidebar-hint {
    margin: 0 0 10px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #666;
}

.filter-section {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.filter-section-collapsible {
    padding: 0;
    overflow: hidden;
}

.filter-section-collapsible .filter-section-body {
    padding: 6px 8px 8px;
}

.filter-section-title {
    margin: 0;
    padding: 7px 10px;
    font-size: 0.92rem;
    font-weight: bold;
    background: #0077cc;
    color: #fff;
    border-radius: 4px;
    letter-spacing: 0.01em;
}

.filter-section-collapsible .filter-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 7px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.filter-section-collapsible[open] .filter-section-title {
    border-radius: 7px 7px 0 0;
}

.filter-section-collapsible .filter-section-title::-webkit-details-marker,
.filter-section-collapsible .filter-section-title::marker {
    display: none;
    content: '';
}

.filter-section-collapsible .filter-section-title::after {
    content: '';
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    margin-top: -2px;
    border-right: 2px solid rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.95);
    transform: rotate(45deg);
    transition: transform 0.18s ease, margin-top 0.18s ease;
    opacity: 0.9;
}

.filter-section-collapsible[open] .filter-section-title::after {
    margin-top: 2px;
    transform: rotate(-135deg);
}

.filter-section > .filter-section-title {
    margin-bottom: 8px;
}

.filter-section .filter-group {
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    padding: 7px 8px 8px;
    margin-bottom: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-section .filter-group:last-child {
    margin-bottom: 0;
}

.filter-section .filter-group > label:first-child {
    color: #222;
    font-size: 0.86rem;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.filter-section.is-disabled {
    opacity: 0.55;
    background: #ececec;
}

.filter-section.is-disabled .filter-section-title {
    background: #999;
    cursor: not-allowed;
}

.filter-section.is-disabled input,
.filter-section.is-disabled select {
    cursor: not-allowed;
}

.filter-section.is-disabled .filter-group {
    background: #f3f3f3;
    border-color: #ddd;
    box-shadow: none;
}

.filter-baterie-note {
    margin: 0 0 8px;
    color: #555;
    font-style: italic;
}

.filter-section.is-disabled .filter-baterie-note {
    display: block !important;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9rem;
    background: #fff;
}

.filter-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.filter-hint {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: #666;
    line-height: 1.3;
}

.filter-range-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.filter-range > label {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.filter-range-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.filter-range-inputs input[type="number"] {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9rem;
    background: #fff;
}

.filter-range-sep {
    color: #666;
    font-weight: 600;
}

.filter-range-unit {
    font-size: 0.82rem;
    color: #555;
    white-space: nowrap;
}

.filter-range-track {
    position: relative;
    height: 26px;
}

.filter-range-rail,
.filter-range-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 999px;
}

.filter-range-rail {
    left: 0;
    right: 0;
    background: #ccc;
}

.filter-range-fill {
    background: #0077cc;
    left: 0;
    width: 0;
}

.filter-range-track input[type="range"] {
    position: absolute;
    left: 0;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    pointer-events: none;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
}

.filter-range-track input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
    border: none;
}

.filter-range-track input[type="range"]::-moz-range-track {
    height: 6px;
    background: transparent;
    border: none;
}

.filter-range-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #0077cc;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.filter-range-track input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #0077cc;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.filter-range-max {
    z-index: 2;
}

.filter-range-min {
    z-index: 3;
}

.filter-section.is-disabled .filter-range-fill {
    background: #999;
}

.filter-section.is-disabled .filter-range-track input[type="range"]::-webkit-slider-thumb,
.filter-section.is-disabled .filter-range-track input[type="range"]::-moz-range-thumb {
    background: #999;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    font-size: 0.85rem;
    cursor: pointer;
}

.filter-check input {
    margin: 0;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.filter-actions button,
.filter-actions .btn-reset {
    width: 100%;
    padding: 10px 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.filter-actions .btn-filter {
    padding: 12px 10px;
    background: #d32f2f;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.35);
}

.filter-actions .btn-filter:hover {
    background: #b71c1c;
}

.filter-actions .btn-reset {
    background: #666;
    color: #fff;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.filter-actions .btn-reset:hover {
    background: #444;
}

@media (max-width: 900px) {
    .page-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }

    .sidebar-inner {
        padding-bottom: 16px;
    }
}
