/* Архив объявлений OLX — оформление в духе площадки */

:root {
  --teal:        #002f34;
  --teal-soft:   #0b4b53;
  --bg:          #f2f4f5;
  --card:        #ffffff;
  --line:        #e4e6e8;
  --text:        #002f34;
  --muted:       #6b7b7d;
  --accent:      #23e5db;
  --danger:      #d0021b;
  --danger-soft: #fdecee;
  --radius:      6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; font-weight: 700; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- шапка ---------- */

.topbar { background: var(--teal); color: #fff; }

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 12px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: #fff;
}

.logo-icon { display: block; flex: 0 0 auto; }

.logo-word {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
}

.logo:hover .logo-icon { filter: brightness(1.06); }

.searchbar { flex: 1 1 320px; display: flex; gap: 8px; min-width: 260px; }

.searchbar input[type=search] {
  flex: 1;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

.searchbar input[type=search]:focus { outline: none; border-color: var(--accent); }

.searchbar button {
  background: var(--accent);
  color: var(--teal);
  border: 0;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.searchbar button:hover { filter: brightness(.94); }

.topstats { text-align: right; line-height: 1.1; flex: 0 0 auto; }
.topstats span { font-size: 18px; font-weight: 700; display: block; }
.topstats small { font-size: 11px; opacity: .8; }

/* ---------- сетка страницы ---------- */

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
  padding-block: 20px;
}

/* ---------- фильтры ---------- */

.filters { position: sticky; top: 16px; }

.filters-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}
.filters-toggle.on { background: var(--teal); color: #fff; border-color: var(--teal); }

.fbox {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.fhead { font-weight: 700; font-size: 14px; margin-bottom: 10px; }

.hint { font-size: 11px; color: var(--muted); margin: 8px 0 0; line-height: 1.35; }

.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--teal); width: 16px; height: 16px; }

.segmented { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg { flex: 1; text-align: center; padding: 7px 4px; font-size: 13px; cursor: pointer; background: #fff; }
.seg { position: relative; }
.seg input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.seg.on { background: var(--teal); color: #fff; font-weight: 600; }

.row2 { display: flex; gap: 8px; }
.row2 input { width: 100%; }

.fbox input[type=number], .fbox select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  background: #fff;
  color: var(--text);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
}

.chip { position: relative; }
.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.chip.on { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 600; }

.btn-primary {
  display: block;
  width: 100%;
  background: var(--teal);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 11px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover { background: var(--teal-soft); }
.btn-primary.inline { display: inline-block; width: auto; padding: 11px 24px; }

.btn-reset { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--muted); }
.btn-reset:hover { color: var(--text); text-decoration: underline; }

/* ---------- заголовок выдачи ---------- */

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.results-head h1 { font-size: 20px; }
.results-head .count { color: var(--muted); font-weight: 400; font-size: 15px; margin-left: 6px; }

.sortform select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
}

/* ---------- карточки ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}

.card:hover { box-shadow: 0 6px 18px rgba(0, 47, 52, .13); transform: translateY(-2px); }
.card.is-removed { border-color: #f2c4ca; }

.thumb { position: relative; aspect-ratio: 4 / 3; background: #e9ecec; max-width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
}

.badge-removed {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 3px;
  letter-spacing: .2px;
}

.badge-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 47, 52, .78);
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 3px;
}

.card-body { padding: 10px 12px 12px; }

.card-title {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.card-price { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.card-specs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-date { flex: 0 0 auto; }

/* ---------- пустая выдача ---------- */

.empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty.tall { margin: 32px 0; }
.empty-title { font-size: 19px; font-weight: 700; color: var(--text); margin: 0 0 8px; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--bg);
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  margin-top: 8px;
}

/* ---------- пагинация ---------- */

.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 26px 0; flex-wrap: wrap; }

.pager a, .pager .cur {
  min-width: 38px;
  text-align: center;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
}

.pager a:hover { border-color: var(--teal); }
.pager .cur { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 700; }
.pager .gap { color: var(--muted); padding: 0 4px; }

/* ---------- карточка объявления ---------- */

.detail { padding-block: 18px; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 7px; flex-wrap: wrap; }
.crumbs a:hover { text-decoration: underline; }

.notice-removed {
  background: var(--danger-soft);
  border: 1px solid #f3b8c0;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.notice-removed strong { display: block; color: var(--danger); margin-bottom: 3px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.detail-main { min-width: 0; }

.gallery {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.gal-main {
  aspect-ratio: 4 / 3;
  background: #111;
  max-width: 100%;
  min-width: 0;
  max-height: 560px;
}
.gal-main img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.gal-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecec;
  color: var(--muted);
  font-size: 14px;
}

.gal-thumbs { display: flex; gap: 7px; padding: 10px; overflow-x: auto; }

.gal-thumb {
  flex: 0 0 76px;
  height: 58px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: none;
}

.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-thumb.on { border-color: var(--teal); }

.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 14px;
}

.block h2 { font-size: 17px; margin-bottom: 12px; }

.descr { font-size: 15px; line-height: 1.6; word-wrap: break-word; }

.params { width: 100%; border-collapse: collapse; font-size: 14px; }
.params td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.params tr:last-child td { border-bottom: 0; }
.pk { color: var(--muted); width: 48%; padding-right: 12px; }
.pv { font-weight: 500; }
.params.small { font-size: 13px; }
.params.small td { padding: 6px 0; }

.detail-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }

.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.side-price { font-size: 28px; font-weight: 800; line-height: 1.1; }
.side-persqm { font-size: 13px; color: var(--muted); margin-top: 3px; }
.side-negot { font-size: 12px; color: var(--muted); margin-top: 3px; }
.side-title { font-size: 17px; font-weight: 600; margin: 12px 0 8px; line-height: 1.35; }
.side-specs { font-size: 14px; color: var(--text); margin-bottom: 8px; }
.side-place { font-size: 14px; color: var(--muted); }
.side-date { font-size: 12px; color: var(--muted); margin-top: 6px; }
.side-head { font-weight: 700; font-size: 14px; margin-bottom: 10px; }

.seller-name { font-size: 15px; font-weight: 600; }
.seller-type { font-size: 13px; color: var(--muted); margin-top: 2px; }
.seller-phone { font-size: 15px; margin-top: 8px; font-weight: 600; }
.seller-rating { margin-top: 6px; font-size: 14px; color: var(--text); }
.seller-rating-score { font-weight: 700; font-size: 16px; }
.seller-rating-max { color: var(--muted); font-size: 13px; }
.seller-rating-count { color: var(--muted); font-size: 13px; }
.seller-rating-empty { color: var(--muted); font-size: 13px; }


.tag-active { color: #0a7d2b; font-weight: 600; }
.tag-removed { color: var(--danger); font-weight: 600; }

.side-link {
  display: block;
  margin-top: 10px;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}

.side-link:hover { background: var(--teal); color: #fff; }
.side-link.dead { border-color: var(--line); color: var(--muted); text-decoration: line-through; }
.side-link.dead:hover { background: none; color: var(--muted); }

.muted { color: var(--muted); }

/* ---------- подвал ---------- */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding-block: 20px;
  font-size: 13px;
  color: var(--muted);
  background: #fff;
}

.footer .dot { margin: 0 8px; opacity: .5; }

/* ---------- адаптив ---------- */

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .filters-toggle { display: flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}

@media (max-width: 620px) {
  .topbar-inner { gap: 10px; }
  .topstats { display: none; }
  .logo-word { font-size: 18px; }
  .logo-icon { width: 24px; height: 24px; }
  .searchbar { min-width: 0; flex: 1 1 auto; }
  .searchbar button { padding: 10px 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .card-price { font-size: 17px; }
  .side-price { font-size: 24px; }
  .footer .dot { display: none; }
  .footer span { display: block; }

  .gallery {
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    max-width: none; /* иначе desktop max-width:100% ломает full-bleed */
    border-left: 0;
    border-right: 0;
  }
  .gal-main {
    aspect-ratio: 4 / 3;
    width: 100%;
    max-width: none;
    max-height: 70vh;
    touch-action: pan-x pan-y;
    cursor: zoom-in;
    background: #111;
  }
  .gal-main img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    pointer-events: none;
  }
  .gal-thumbs {
    gap: 8px;
    padding: 10px 16px 12px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    max-width: 100%;
  }
  .gal-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    scroll-snap-align: start;
  }
}


.seller-link {
  display: inline-block;
  color: var(--teal);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.seller-link:hover { text-decoration: underline; }
.seller-history {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
}
.seller-banner {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.seller-banner a { color: var(--teal); font-weight: 600; }


/* ---------- lightbox / mobile zoom ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.94);
  color: #fff;
}
.lightbox.open { display: block; }
.lb-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  z-index: 2;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.lb-close { top: 12px; right: 12px; font-size: 32px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }


/* Desktop: фильтры в колонке. Mobile: оверлей */
@media (min-width: 1001px) {
  .filters-toggle { display: none !important; }
  .filters {
    display: block !important;
    position: sticky !important;
    top: 16px;
  }
  .filters-applybar { display: none !important; }
  .filters-desktop-actions { display: block; }
}
@media (max-width: 1000px) {
  .filters-toggle {
    display: flex !important;
    position: relative;
    z-index: 5;
  }
  .filters-desktop-actions { display: none !important; }

  body.filters-open {
    overflow: hidden;
    touch-action: none;
  }

  .filters {
    display: none;
    position: fixed !important;
    inset: 0;
    z-index: 8000;
    background: rgba(0, 47, 52, 0.45);
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
  .filters.is-open {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
  }
  .filters form#filterform {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--bg);
    border-radius: 16px 16px 0 0;
    max-height: none;
    height: calc(100vh - 72px - env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 12px;
    overscroll-behavior: contain;
  }
  .filters-applybar {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  }
  .filters-applybar .btn-primary {
    flex: 1;
    margin: 0;
    width: auto;
  }
  .filters-applybar .filters-reset-mob {
    flex: 0 0 auto;
    padding: 12px 10px;
    margin: 0;
  }
}


/* ---------- карта ---------- */

.topnav {
  display: inline-flex;
  gap: 4px;
  flex: 0 0 auto;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 3px;
}

.topnav-link {
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

.topnav-link:hover { opacity: 1; }
.topnav-link.is-on {
  background: var(--accent);
  color: var(--teal);
  opacity: 1;
}

body.page-map {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.page-map .footer { display: none; }
body.page-map .topbar { flex: 0 0 auto; }

.map-page {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
  height: calc(100vh - 64px);
}

.map-filters {
  background: var(--card);
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 12px;
}

.map-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.map-back-list {
  font-size: 13px;
  color: var(--teal-soft);
  font-weight: 600;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.estate-map {
  width: 100%;
  height: 100%;
  background: #d9e2e3;
}

.map-hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  max-width: calc(100% - 24px);
}

.map-filters-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  display: none;
}

.map-pin-wrap, .map-cluster-wrap { background: none !important; border: none !important; }
.map-pin {
  transform: translate(-50%, -100%);
  background: #fff;
  color: var(--teal);
  border: 2px solid var(--teal);
  border-radius: 14px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,47,52,0.2);
}
.map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--teal);
}
.map-pin.is-removed {
  border-color: var(--danger);
  color: var(--danger);
  opacity: 0.9;
}
.map-pin.is-removed::after { border-top-color: var(--danger); }

.map-cluster {
  transform: translate(-50%, -50%);
  background: var(--teal);
  color: #fff;
  border: 3px solid var(--accent);
  border-radius: 999px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,47,52,0.25);
}
.map-cluster-sm { width: 36px; height: 36px; font-size: 12px; }
.map-cluster-md { width: 46px; height: 46px; font-size: 13px; }
.map-cluster-lg { width: 56px; height: 56px; font-size: 14px; }

.map-popup { min-width: 180px; }
.map-popup-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--teal);
}
.map-popup-title:hover { text-decoration: underline; }
.map-popup-price { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.map-popup-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.map-popup-tag {
  display: inline-block;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.map-popup-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-soft);
}

@media (max-width: 900px) {
  .map-page {
    grid-template-columns: 1fr;
    height: calc(100vh - 110px);
  }
  .map-filters {
    display: none;
    position: absolute;
    z-index: 600;
    top: 0; left: 0; bottom: 0;
    width: min(320px, 92vw);
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
  }
  .map-filters.is-open { display: block; }
  .map-filters-toggle { display: inline-flex; }
  .topnav { order: 3; width: 100%; justify-content: center; }
}


/* ---------- burger + menu ---------- */

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 1px;
}
.burger:hover { background: rgba(255,255,255,0.2); }

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 47, 52, 0.45);
}
.site-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 9001;
  width: min(320px, 88vw);
  background: #fff;
  color: var(--text);
  box-shadow: 8px 0 24px rgba(0,0,0,0.18);
  padding: 12px 0 24px;
  overflow-y: auto;
}
.site-menu[hidden], .menu-backdrop[hidden] { display: none !important; }
.site-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.menu-close {
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  width: 40px;
  height: 40px;
}
.site-menu-link {
  display: block;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.site-menu-link:hover { background: var(--bg); }
.site-menu-link.is-on {
  color: var(--teal);
  background: #e8f8f7;
  border-right: 3px solid var(--accent);
}
body.menu-open { overflow: hidden; }

.topnav { display: none !important; } /* заменено бургером */

/* ---------- статистика ---------- */

.stats-page { padding-block: 22px 40px; overflow-x: hidden; }
.stats-head { margin-bottom: 22px; }
.stats-head h1 { font-size: 24px; margin-bottom: 6px; }
.stats-lead { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.stats-periods { display: flex; gap: 8px; flex-wrap: wrap; }
.stats-period {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.stats-period.is-on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.stats-day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 8px;
  margin-bottom: 12px;
  overflow-x: hidden;
}
.stats-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.stats-day-head h2 { font-size: 17px; }
.stats-day-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--teal);
}
.stats-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 14px; }
.stats-table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.stats-table td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stats-table tr:last-child td { border-bottom: 0; }
.stats-city { width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-cnt { width: 18%; font-weight: 700; white-space: nowrap; }
.stats-bar-cell { width: 40%; overflow: hidden; max-width: 100%; }
.stats-bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
  min-width: 4px;
  max-width: 100%;
  box-sizing: border-box;
}

.filters-applybar { display: none; }


.badge-spam {
  position: absolute;
  left: 8px;
  top: 8px;
  background: #b42318;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 2;
}
.notice-spam {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.tag-spam { color: #b42318; font-weight: 700; }
.seller-reg { margin-top: 6px; font-size: 13px; color: var(--muted); }
.seller-olx-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
}
.seller-olx-link:hover { text-decoration: underline; }


.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}
.stats-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stats-kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.stats-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.1;
}
.stats-kpi-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.stats-day-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: baseline;
  justify-content: flex-end;
}
.stats-day-metric {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.stats-day-metric strong {
  color: var(--teal);
  font-size: 18px;
  font-weight: 800;
  margin-right: 2px;
}
.stats-day-metric-size {
  color: var(--text);
  font-weight: 600;
}
.stats-day-empty { margin: 0 0 4px; font-size: 13px; }
@media (max-width: 900px) {
  .stats-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .stats-summary { grid-template-columns: 1fr; }
  .stats-day-head { flex-direction: column; align-items: flex-start; }
  .stats-day-metrics { justify-content: flex-start; }
}
