/* Стили перенесены из EstateCatalogBlazorAppWasm (app.css и изолированные *.razor.css) */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

code {
    color: #c02d76;
}

/* ---------- Каркас ---------- */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

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

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

/* ---------- Меню ---------- */

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.top-row {
    min-height: 3.5rem;
    background-color: rgba(0, 0, 0, 0.4);
}

.navbar-brand {
    font-size: 1.1rem;
}

.sidebar .nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.sidebar .nav-item a {
    color: #d7d7d7;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
}

.sidebar .nav-item a.active {
    background-color: rgba(255, 255, 255, 0.37);
    color: white;
}

.sidebar .nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-home-icon {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

/* Стрелка «Назад» слева от названия */
.back-button {
    background: none;
    border: 0;
    color: white;
    padding: 0.25rem 0.5rem 0.25rem 0;
    margin-right: 0.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    font-size: 22px;
}

.back-button:active {
    opacity: 0.6;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .navbar-toggler {
        display: none;
    }

    /* На широком экране меню не сворачивается */
    .nav-scrollable.collapse {
        display: block;
    }

    .nav-scrollable {
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }

    article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* ---------- Фильтр ---------- */

.filter-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .25rem;
}

.filter-options {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 .375rem .375rem;
    padding: .5rem .75rem;
}

.estate-filter {
    border-color: #dee2e6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
}

.estate-filter .form-check {
    padding-top: .15rem;
    padding-bottom: .15rem;
}

/* ---------- Список объектов ---------- */

.estate-item {
    padding: .6rem .5rem .7rem .9rem;
    display: block;
}

.estate-link {
    color: inherit;
    text-decoration: none;
}

.estate-item:hover {
    background-color: #f8f9fa;
}

.estate-address {
    font-weight: 600;
    color: #212529;
    line-height: 1.25;
}

.estate-meta {
    font-size: .85rem;
    color: #6c757d;
    margin-top: .15rem;
}

.estate-figures {
    font-size: .9rem;
    color: #212529;
    row-gap: .15rem;
}

.estate-archived {
    background-color: #f5f5f5;
}

.estate-archived .estate-address {
    color: #6c757d;
}

.sel-btn {
    padding: .25rem .4rem;
    font-size: 1.4rem;
    line-height: 1;
    text-decoration: none;
}

.thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: #e9ecef;
}

/* ---------- Заявки ---------- */

.req-item { padding: .6rem .5rem .7rem .9rem; color: inherit; }
.req-active { border-left: 4px solid #dc3545; }
.req-forwhat { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req-label { display: block; font-size: .78rem; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .25rem; }
.req-regions { max-height: 260px; overflow-y: auto; border: 1px solid #dee2e6; border-radius: .375rem; padding: .4rem .75rem; }
.req-savebar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #dee2e6; padding: .6rem 0; z-index: 5; }

/* ---------- Авито ---------- */

.avito-item { padding: .6rem .5rem .7rem .9rem; color: inherit; }
.avito-unread { border-left: 4px solid #0d6efd; }
.avito-object { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .85rem; }
.avito-text { white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Фото объекта ---------- */

.pv-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; margin: 0 -1.5rem .5rem; padding: 0 1.5rem; }
.pv-gallery .pv-item { flex: 0 0 88%; scroll-snap-align: center; margin-right: 8px; display: block; cursor: pointer; }
.pv-gallery .pv-item:last-child { margin-right: 0; }
.pv-gallery .pv-item:only-child { flex-basis: 100%; }
.pv-gallery img, .pv-gallery .pv-ph { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #e9ecef; }
@media (min-width: 700px) { .pv-gallery .pv-item { flex-basis: 60%; } }
.pv-hint { font-size: 13px; color: #6c757d; margin: -2px 0 12px; }
.pv-lb { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2000; background: #000; display: flex; flex-direction: column; }
.pv-lb[hidden] { display: none; }
.pv-top { display: flex; align-items: center; justify-content: space-between; color: #fff; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
.pv-count { font-size: 15px; opacity: .85; }
.pv-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 26px; line-height: 44px; padding: 0; }
.pv-track { flex: 1 1 auto; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pv-track::-webkit-scrollbar { display: none; }
.pv-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; }
.pv-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pv-nav { position: absolute; top: 50%; margin-top: -26px; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 32px; line-height: 52px; padding: 0; display: none; }
.pv-nav:disabled { opacity: .25; }
.pv-prev { left: 12px; }
.pv-next { right: 12px; }
.pv-bottom { height: max(12px, env(safe-area-inset-bottom)); }
@media (hover: hover) and (pointer: fine) { .pv-nav { display: block; } }
