.main-grid {
    display: flex;
    gap: 24px;
    padding: 20px;
    align-items: flex-start;
}

.main-global-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-global-loader img {
    width: 48px;
    height: 48px;
}

.main-popup-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-popup-loader-overlay img {
    width: 42px;
    height: 42px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.main-mobile-filter-toggle,
.mobile-filters-header,
.main-filters-backdrop {
    display: none;
}

.sidebar-filters {
    width: 320px;
    background: #ffffff;
    border: 1px solid #e7e9ee;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
    position: sticky;
    top: 16px;
}

#map {
    width: 100%;
    height: 520px;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid #e7e9ee;
    overflow: hidden;
}

.main-map-cluster {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #c7181d;
    color: #ffffff;
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.surfaces-table-container {
    overflow-x: auto;
    border: 1px solid #e7e9ee;
    border-radius: 12px;
    background: #ffffff;
}

.surfaces-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: #ffffff;
}

.surfaces-table th,
.surfaces-table td {
    border-bottom: 1px solid #edf0f5;
    padding: 11px 12px;
    text-align: left;
    white-space: nowrap;
}

.surfaces-table th:first-child,
.surfaces-table td:first-child {
    padding-left: 12px !important;
}

.surfaces-table th {
    background-color: #f7f8fa;
    font-weight: 600;
    color: #2d3643;
}

.surfaces-table tbody tr:last-child td {
    border-bottom: 0;
}

.surfaces-table tr:hover {
    background-color: #f4f7ff;
    cursor: pointer;
}

.filter-group {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf0f5;
}

.filter-group:last-of-type {
    border-bottom: 0;
    margin-bottom: 18px;
    padding-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.25;
    color: #3b4350;
}

.filter-group input[type="text"],
.filter-group select,
.filter-group input[type="number"] {
    width: 100%;
    height: 42px;
    padding: 10px 11px;
    box-sizing: border-box;
    border: 1px solid #d7dce6;
    border-radius: 8px;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.3;
}

.filter-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, #5b6678 50%), linear-gradient(135deg, #5b6678 50%, transparent 50%);
    background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

#status-month-select {
    margin-bottom: 10px;
}

.filter-location {
    display: grid;
    gap: 8px;
}

.price-slider-container {
    margin-top: 10px;
    margin-bottom: 8px;
    padding: 0 4px;
}

#price-range {
    margin-top: 10px;
    height: 8px;
    border-radius: 999px;
    border: 1px solid #d7dce6;
    background: #eef2f7;
    overflow: visible !important;
    position: relative;
}

#price-range .ui-slider-range {
    background: #2d3643;
}

#price-range .ui-slider-handle {
    display: block !important;
    z-index: 3 !important;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #2d3643;
    background: #ffffff;
    top: -6px;
    cursor: pointer;
}

.price-range-native input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 8px;
    margin: 0;
    transform: translateY(-50%);
    background: transparent;
    pointer-events: none;
}

.price-range-native input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: transparent;
    border: none;
}

.price-range-native input[type="range"]::-moz-range-track {
    height: 8px;
    background: transparent;
    border: none;
}

.price-range-native input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #2d3643;
    background: #fff;
    margin-top: -5px;
    cursor: pointer;
    pointer-events: auto;
}

.price-range-native input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #2d3643;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.status-filters {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.status-chip {
    display: block;
    margin: 0;
    position: relative;
}

.status-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.status-chip span {
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .14s ease, opacity .14s ease;
}

.status-chip input:not(:checked) + span {
    opacity: .45;
}

.status-chip input:checked + span,
.status-chip.is-active span {
    box-shadow: inset 0 0 0 2px #111827;
    opacity: 1;
}

.status-chip--free span {
    background-color: #14a44d;
    color: #ffffff;
}

.status-chip--reserved span {
    background-color: #f8e06b;
    color: #1f2937;
}

.status-chip--occupied span {
    background-color: #f05c5c;
    color: #ffffff;
}

.price-slider-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3643;
}

.back-to-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    background: #2d3643;
    color: #ffffff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.22);
}

.back-to-top:hover {
    background: #1f2731;
}

#construction-modal.modal-window_open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    inset: 0;
    z-index: 9999 !important;
    background: rgba(10, 15, 25, 0.56);
    padding: 22px;
}

#construction-modal {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

#construction-modal.modal-window_open .modal-inner {
    display: block !important;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 14px;
    width: min(870px, calc(100vw - 88px));
    max-height: calc(100vh - 44px);
    overflow: hidden;
    box-shadow: 0 28px 56px rgba(16, 24, 40, 0.28);
    position: relative;
}

#construction-modal .modal-inner__content {
    padding: 20px 22px;
    max-height: calc(100vh - 44px);
    overflow: auto;
}

#construction-modal .modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 24px;
    color: #4a5565;
}

#construction-modal .construction-details h3 {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.3;
}

#construction-modal .tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e9edf3;
    padding-bottom: 10px;
}

#construction-modal .tab {
    padding: 8px 12px;
    border: 1px solid #d9e0eb;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
}

#construction-modal .tab.active {
    background: #ffffff;
    border-color: #b9c6da;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
    font-weight: 600;
}

#construction-modal .tab-content {
    display: none;
}

#construction-modal .tab-content.active {
    display: block;
}

#construction-modal .surface-header-layout {
    display: grid;
    grid-template-columns: 369px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 10px;
}

#construction-modal .surface-photos-col {
    min-width: 0;
}

#construction-modal .surface-main-photo-wrap {
    margin-bottom: 10px;
}

#construction-modal .js-surface-main-photo {
    width: 100%;
    height: 238px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #d8deea;
}

#construction-modal .surface-details-col {
    min-width: 0;
    padding-top: 2px;
}

#construction-modal .detail-row {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-bottom: 8px;
}

#construction-modal .detail-label {
    font-weight: 600;
    color: #5b6678;
}

#construction-modal .detail-value {
    min-width: 0;
    color: #1f2937;
}

#construction-modal .price-block {
    margin-top: 0;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e4e8f0;
    background: #f8fafc;
}

#construction-modal .old-price {
    text-decoration: line-through;
    color: #8892a4;
    margin-right: 8px;
}

#construction-modal .current-price {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #14a44d;
}

#construction-modal .calendar-container {
    margin-top: 0;
    min-width: 0;
}

#construction-modal .surface-bottom-layout {
    display: grid;
    grid-template-columns: max-content minmax(300px, 1fr);
    gap: 22px;
    align-items: end;
}

#construction-modal .surface-actions-col {
    position: static;
    margin-top: 0;
    align-self: end;
}

#construction-modal .surface-actions-buttons {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

#construction-modal .surface-actions-buttons .button {
    width: 100%;
}

#construction-modal .surface-copy-link {
    display: inline-block;
    margin-left: 10px;
    margin-top: 0;
    font-size: 13px;
    color: #667085;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#construction-modal .price-note {
    font-size: 16px;
    color: #666;
    margin-top: 5px;
    white-space: nowrap;
}

#construction-modal .calendar-legend {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px 0 10px;
}

#construction-modal .calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    text-transform: lowercase;
}

#construction-modal .calendar-legend-color {
    width: 14px;
    height: 14px;
    display: inline-block;
}

#construction-modal .calendar-year-title {
    font-weight: 500;
    margin-bottom: 6px;
    color: #9ca3af;
    font-size: 16px;
    line-height: 1;
}

#construction-modal .calendar-years {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 0 !important;
}

#construction-modal .calendar-year-block {
    flex: 0 0 auto;
}

#construction-modal .calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 0;
}

#construction-modal .calendar-month {
    border: 0;
    padding: 7px 6px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    border-radius: 0;
    line-height: 1;
    width: 35px;
    height: 22px;
    min-height: 22px;
    min-width: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
    transition: transform .08s ease, box-shadow .12s ease;
}

#construction-modal .calendar-month:hover {
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.25);
}

#construction-modal .status-free {
    background-color: #14a44d;
    color: #ffffff;
}

#construction-modal .status-occupied {
    background-color: #f05c5c;
    color: #ffffff;
}

#construction-modal .status-reserved {
    background-color: #f8e06b;
    color: #1f2937;
}

#construction-modal .status-past {
    background-color: #eef1f6;
    color: #97a1b2;
    cursor: default;
}

#construction-modal .calendar-month.selected {
    box-shadow: inset 0 0 0 2px #111827 !important;
}

#construction-modal .status-disabled {
    cursor: not-allowed !important;
    opacity: 0.72;
}

#construction-modal .calendar-month.is-status-saving {
    cursor: wait !important;
    opacity: 0.62;
}

#construction-modal .photo-gallery {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#construction-modal .photo-gallery img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d8deea;
}

@media (max-width: 1100px) {
    .main-grid {
        flex-direction: column;
        gap: 14px;
        padding: 14px 12px 20px;
    }

    .header .user {
        margin-right: 178px;
    }

    .main-mobile-filter-toggle {
        position: fixed;
        top: 20px;
        right: 100px;
        z-index: 6;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 92px;
        height: 40px;
        padding: 0 14px;
        border: 1px solid #d7dce6;
        border-radius: 8px;
        background: #ffffff;
        color: #2d3643;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        box-shadow: 0 6px 16px rgba(16, 24, 40, 0.12);
    }

    #map {
        height: clamp(240px, 42dvh, 360px);
        margin-bottom: 14px;
        border-radius: 10px;
    }

    .surfaces-table-container {
        max-height: 48dvh;
        overflow: auto;
        border-radius: 10px;
    }

    .surfaces-table {
        font-size: 13px;
    }

    .surfaces-table th,
    .surfaces-table td {
        padding: 9px 10px;
    }

    .sidebar-filters {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 2001;
        width: min(360px, 92vw);
        max-width: none;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: -12px 0 28px rgba(16, 24, 40, 0.18);
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform .2s ease;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-filters.is-open {
        transform: translateX(0);
    }

    .sidebar-filters form {
        padding: 14px;
    }

    .mobile-filters-header {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        height: 58px;
        padding: 0 14px;
        border-bottom: 1px solid #e7e9ee;
        background: #ffffff;
    }

    .mobile-filters-header strong {
        font-size: 18px;
        line-height: 1.2;
        color: #2d3643;
    }

    .mobile-filters-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid #d7dce6;
        border-radius: 8px;
        background: #ffffff;
        color: #2d3643;
        font-size: 28px;
        line-height: 1;
    }

    .main-filters-backdrop {
        position: fixed;
        inset: 0;
        z-index: 2000;
        background: rgba(10, 15, 25, 0.44);
    }

    .main-filters-backdrop.is-open {
        display: block;
    }

    body.main-filters-open {
        overflow: hidden;
    }

    .back-to-top {
        width: 42px;
        height: 42px;
        right: 14px;
        bottom: 18px;
    }
}

@media (max-width: 900px) {
    #construction-modal.modal-window_open {
        padding: 10px;
    }

    #construction-modal.modal-window_open .modal-inner {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    #construction-modal .modal-inner__content {
        padding: 14px;
    }

    #construction-modal .detail-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    #construction-modal .surface-header-layout {
        grid-template-columns: 1fr;
    }

    #construction-modal .surface-bottom-layout {
        grid-template-columns: 1fr;
        align-items: start;
    }

    #construction-modal .surface-actions-col {
        position: static;
        margin-top: 0;
    }

    #construction-modal .calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
