.sidebar {
    width: 320px;
    background: #f4f7fb;
    border-right: 1px solid #d8e3ef;
    flex-shrink: 0;
    box-sizing: border-box;
    align-self: stretch;
}

.sidebar-inner {
    padding: 14px 14px 18px;
    box-sizing: border-box;
}

/* —— Hlavička filtru —— */

.sidebar-filter-head {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d8e3ef;
}

.sidebar-filter-title {
    margin: 0 0 6px;
    font-size: 1.12rem;
    font-weight: 700;
    color: #123a5c;
    letter-spacing: -0.01em;
}

.sidebar-filter-lead {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #5a7086;
}

/* —— Kompaktní nástroje pod filtrem —— */

.sidebar-tools {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #d8e3ef;
}

.sidebar-tools-label {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6a8094;
}

.sidebar-tools-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-tools-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid #d8e3ef;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-tools-item:hover {
    border-color: #9ec5e8;
    background: #f8fbfe;
    box-shadow: 0 2px 8px rgba(8, 95, 163, 0.08);
}

.sidebar-tools-item.is-active {
    border-color: #085fa3;
    background: #f0f7fd;
    box-shadow: inset 0 0 0 1px rgba(8, 95, 163, 0.12);
}

.sidebar-tools-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #e8f2fa;
    color: #085fa3;
}

.sidebar-tools-item.is-active .sidebar-tools-icon {
    background: #085fa3;
    color: #fff;
}

.sidebar-tools-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-tools-text strong {
    font-size: 0.86rem;
    font-weight: 700;
    color: #123a5c;
    line-height: 1.25;
}

.sidebar-tools-text small {
    font-size: 0.76rem;
    line-height: 1.35;
    color: #6a8094;
}

/* —— Sekce filtru —— */

.filter-section {
    background: #fff;
    border: 1px solid #d8e3ef;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(8, 50, 90, 0.04);
}

.filter-section-collapsible {
    padding: 0;
    overflow: hidden;
}

.filter-section-collapsible .filter-section-body {
    padding: 8px 10px 10px;
}

.filter-section-title {
    margin: 0;
    padding: 8px 11px;
    font-size: 0.88rem;
    font-weight: 700;
    background: linear-gradient(180deg, #0a6ebd 0%, #085fa3 100%);
    color: #fff;
    border-radius: 7px;
    letter-spacing: 0.01em;
}

.filter-section-collapsible .filter-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 9px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.filter-section-collapsible[open] .filter-section-title {
    border-radius: 9px 9px 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: #f8fafc;
    border: 1px solid #e2eaf2;
    border-radius: 8px;
    padding: 8px 9px 9px;
    margin-bottom: 7px;
}

.filter-section .filter-group:last-child {
    margin-bottom: 0;
}

.filter-section .filter-group > label:first-child {
    color: #2a4258;
    font-size: 0.84rem;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e8eef4;
}

.filter-section.is-disabled {
    opacity: 0.55;
    background: #f0f3f7;
}

.filter-section.is-disabled .filter-section-title {
    background: #9aa8b5;
    cursor: not-allowed;
}

.filter-section.is-disabled input,
.filter-section.is-disabled select {
    cursor: not-allowed;
}

.filter-section.is-disabled .filter-group {
    background: #f3f5f8;
    border-color: #e0e6ed;
}

.filter-baterie-note {
    margin: 0 0 8px;
    color: #5a7086;
    font-style: italic;
    font-size: 0.82rem;
}

.filter-section.is-disabled .filter-baterie-note {
    display: block !important;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.84rem;
    color: #2a4258;
}

.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 8px 9px;
    border: 1px solid #c5d6e8;
    border-radius: 7px;
    box-sizing: border-box;
    font-size: 0.88rem;
    background: #fff;
    color: #1a2f42;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #085fa3;
    box-shadow: 0 0 0 3px rgba(8, 95, 163, 0.12);
}

.filter-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.filter-hint {
    margin: 4px 0 0;
    font-size: 0.76rem;
    color: #6a8094;
    line-height: 1.35;
}

.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 #e8eef4;
}

.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: 7px 8px;
    border: 1px solid #c5d6e8;
    border-radius: 7px;
    box-sizing: border-box;
    font-size: 0.88rem;
    background: #fff;
}

.filter-range-sep {
    color: #6a8094;
    font-weight: 600;
}

.filter-range-unit {
    font-size: 0.8rem;
    color: #5a7086;
    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: #d0dce8;
}

.filter-range-fill {
    background: #085fa3;
    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: #085fa3;
    box-shadow: 0 1px 4px rgba(8, 50, 90, 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: #085fa3;
    box-shadow: 0 1px 4px rgba(8, 50, 90, 0.25);
    cursor: pointer;
}

.filter-range-max {
    z-index: 2;
}

.filter-range-min {
    z-index: 3;
}

.filter-section.is-disabled .filter-range-fill {
    background: #9aa8b5;
}

.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: #9aa8b5;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: #fff;
    border: 1px solid #d8e3ef;
    border-radius: 7px;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    font-size: 0.84rem;
    cursor: pointer;
}

.filter-check input {
    margin: 0;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
}

.filter-actions button,
.filter-actions .btn-reset {
    width: 100%;
    padding: 11px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 0.92rem;
    box-sizing: border-box;
}

.filter-actions .btn-filter {
    background: linear-gradient(180deg, #e53935 0%, #c62828 100%);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.32);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.filter-actions .btn-filter:hover {
    background: linear-gradient(180deg, #c62828 0%, #b71c1c 100%);
    box-shadow: 0 3px 10px rgba(198, 40, 40, 0.4);
}

.filter-actions .btn-reset {
    background: #fff;
    color: #4a6278;
    border: 1px solid #c5d6e8;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.filter-actions .btn-reset:hover {
    background: #f0f5fa;
    color: #2a4258;
}

@media (max-width: 900px) {
    .page-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #d8e3ef;
    }

    .sidebar-inner {
        padding-bottom: 16px;
    }
}
