/* ===== CSS Variables ===== */
:root {
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-primary: #e67e22;
  --color-primary-dark: #d35400;
  --color-text: #2c3e50;
  --color-text-muted: #7f8c8d;
  --color-border: #e0e0e0;
  --color-success: #27ae60;
  --color-danger: #e74c3c;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font); background: var(--color-bg); color: var(--color-text); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, button, textarea { font-family: inherit; font-size: inherit; }

/* ===== Layout ===== */
.container {
  margin: 0 auto;
  padding: 0 16px;
}

.main-content {
  padding: 24px 0 48px;
}

/* ===== Notifications ===== */
.notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  font-size: 0.9rem;
  position: sticky;
  top: 56px;
  z-index: 99;
}
.notification-error {
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  color: #b91c1c;
}
.notification-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: inline-flex;
  align-items: center;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-align: center;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: #f0f0f0; }

.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  width: 100%;
  justify-content: center;
  padding: 12px 24px;
  font-size: 1rem;
}
.btn-google:hover { box-shadow: var(--shadow-hover); }

.btn-load-more {
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

.btn-telegram { justify-content: center; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-end;
}

/* ===== Card ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ===== Favorite button ===== */
.realty-card { position: relative; }

.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, background 0.15s;
  padding: 0;
}
.favorite-btn:hover { transform: scale(1.1); background: #fff; }
.favorite-btn svg path {
  fill: none;
  stroke: #bbb;
  stroke-width: 2;
  transition: fill 0.15s, stroke 0.15s;
}
.favorite-btn.is-favorite svg path { fill: #e74c3c; stroke: #e74c3c; }

/* Кнопка на странице детали (с текстом) */
.favorite-btn-detail {
  position: static;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  padding: 10px 16px;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.favorite-btn-detail:hover { transform: none; background: #f0f0f0; }
.favorite-btn-detail.is-favorite { border-color: #e74c3c; color: #e74c3c; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  background: #ecf0f1;
  color: var(--color-text);
}
.badge-district { background: #eaf4fb; color: #2980b9; }
.badge-type { background: #fef9e7; color: #d68910; }
.badge-beds { background: #eafaf1; color: #27ae60; }
.badge-price { background: #fdf2f8; color: #8e44ad; }

/* ===== Filter toggle (mobile only) ===== */
.btn-filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-filter-toggle:hover { background: #f0f0f0; }

.btn-filter-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s;
}
.btn-filter-close:hover { background: #f0f0f0; }

/* ===== Nav hamburger menu (mobile only) ===== */
.nav-menu-checkbox { display: none; }

.nav-hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-hamburger-btn:hover { background: #f0f0f0; }

.nav-hamburger-icon,
.nav-hamburger-icon::before,
.nav-hamburger-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger-icon { position: relative; }
.nav-hamburger-icon::before,
.nav-hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-hamburger-icon::before { top: -6px; }
.nav-hamburger-icon::after  { top: 6px; }

.nav-menu-checkbox:checked ~ .header-inner .header-nav .nav-hamburger-btn .nav-hamburger-icon {
  background: transparent;
}
.nav-menu-checkbox:checked ~ .header-inner .header-nav .nav-hamburger-btn .nav-hamburger-icon::before {
  transform: translateY(6px) rotate(45deg);
}
.nav-menu-checkbox:checked ~ .header-inner .header-nav .nav-hamburger-btn .nav-hamburger-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.filters-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 149;
}
.filters-backdrop.active { display: block; }

/* ===== Page layout (index) ===== */
.page-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
}

/* ===== Filters panel ===== */
.filters-panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  position: sticky;
  top: 72px;
  overflow: hidden;
}

.filters-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

/* Убираем стрелочки у number inputs — Chrome/Safari/Edge */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Убираем стрелочки у number inputs — Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-range input { width: 0; flex: 1; }
.price-range span { color: var(--color-text-muted); }

.price-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.filters-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.filters-actions .btn { justify-content: center; }

/* ===== Cards grid ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ===== Realty card ===== */
.realty-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.realty-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card-link { display: block; }

.card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #ecf0f1;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.realty-card:hover .card-image img { transform: scale(1.03); }

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.card-price { margin-bottom: 4px; }
.price-idr {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}
.price-usd {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.card-date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ===== Load more ===== */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ===== Empty state ===== */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

/* ===== Detail page ===== */
.detail-page {
  max-width: 800px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--color-primary);
  font-size: 0.9rem;
}
.back-link:hover { text-decoration: underline; }

.gallery {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  background: #ecf0f1;
}
.gallery-main img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
}
.gallery-placeholder {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: #f0f0f0;
  overflow-x: auto;
}
.gallery-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.gallery-thumb:hover, .gallery-thumb.active {
  opacity: 1;
  border-color: var(--color-primary);
}

/* Gallery nav arrows */
.gallery-main {
  position: relative;
}
.gallery-main img {
  cursor: zoom-in;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
  user-select: none;
}
.gallery-nav:hover { background: rgba(0, 0, 0, 0.65); }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.active {
  display: flex;
  animation: lightbox-in 0.15s ease;
}
@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}
.lightbox-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 95vw;
  max-height: 90vh;
}
.lightbox-inner img,
.lightbox-inner video {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-counter {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  z-index: 1001;
  pointer-events: none;
}
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
  user-select: none;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-attrs {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.attr-row {
  display: flex;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}
.attr-row:last-child { border-bottom: none; }
.attr-label {
  width: 140px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.attr-value { font-weight: 500; }
.price-usd-detail {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.raw-text-block h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.raw-text {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.7;
  max-height: 400px;
  overflow-y: auto;
}

/* ===== Login page ===== */
.login-page {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  text-align: center;
}
.login-logo { margin-bottom: 12px; display: flex; justify-content: center; }
.login-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
  line-height: 1.5;
}
.login-back { margin-top: 20px; font-size: 0.85rem; color: var(--color-text-muted); }
.login-back a { color: var(--color-primary); }
.login-back a:hover { text-decoration: underline; }

/* ===== Profile page ===== */
.profile-page {
  max-width: 720px;
  margin: 0 auto;
}
.profile-page h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.profile-section {
  margin-bottom: 32px;
}
.profile-section.card { padding: 24px; }
.profile-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.profile-field {
  margin-bottom: 16px;
}
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}
.profile-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.field-value { font-weight: 500; }

.field-edit-row {
  display: flex;
  gap: 8px;
}
.field-edit-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
}
.field-edit-row input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.field-status {
  margin-top: 6px;
  font-size: 0.82rem;
}
.field-status.success { color: var(--color-success); }
.field-status.error { color: var(--color-danger); }

.profile-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 16px 0 12px;
}
.profile-actions { margin-top: 8px; }

/* ===== Subscription card ===== */
.subscription-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.sub-channels {
  display: flex;
  gap: 6px;
}
.channel-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ecf0f1;
  color: var(--color-text-muted);
}
.channel-badge.active.channel-tg { background: #e8f4fd; color: #2980b9; }
.channel-badge.active.channel-email { background: #eafaf1; color: #27ae60; }

/* ===== Subscription form ===== */
.subscription-form {
  padding: 20px;
  margin-bottom: 20px;
}
.subscription-form h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-row input {
  flex: 1;
  width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}
.range-row span { color: var(--color-text-muted); }

.notify-switcher {
  display: inline-flex;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}
.notify-switcher > :first-child {
  border-radius: 8px 0 0 8px;
}
.notify-switcher > :last-child {
  border-radius: 0 8px 8px 0;
}
/* Кнопка внутри span-обёртки (когда Telegram disabled) */
.notify-option-wrapper:last-child .notify-option {
  border-radius: 0 8px 8px 0;
}
.notify-option {
  padding: 6px 20px;
  border: none;
  cursor: pointer;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.notify-option.active {
  background: #22c55e;
  color: #fff;
  font-weight: 500;
}
.notify-option:first-child { border-right: 1px solid #d1d5db; }

.notify-option-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}
.notify-option-wrapper {
  position: relative;
}
[data-tooltip].notify-option-wrapper::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: auto;
  right: 0;
  transform: none;
  background: #1f2937;
  color: #fff;
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 5px;
  white-space: normal;
  max-width: 200px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 10;
}
[data-tooltip].notify-option-wrapper:hover::after {
  opacity: 1;
}

/* ===== Toggle switch ===== */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.toggle-switch input[type="checkbox"] {
  display: none;
}
.toggle-slider {
  display: block;
  width: 42px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}
.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
  background: #22c55e;
}
.toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(18px);
}
#notify-channel-selector {
  display: flex;
  align-items: center;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ===== Error page ===== */
.error-page {
  text-align: center;
  padding: 80px 24px;
}
.error-page h1 {
  font-size: 5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 12px;
}
.error-page p { color: var(--color-text-muted); margin-bottom: 24px; }

/* ===== Utility ===== */
.hidden { display: none !important; }

/* ===== Mobile ===== */
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .attr-label { width: 100px; }
  .subscription-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .btn-filter-toggle { display: flex; }
  .btn-filter-close { display: flex; align-items: center; justify-content: center; }

  .nav-hamburger-btn { display: flex; }

  .nav-links { display: none; }

  .nav-menu-checkbox:checked ~ .header-inner .header-nav .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    padding: 8px 16px 12px;
    gap: 0;
    z-index: 10;
  }

  .nav-menu-checkbox:checked ~ .header-inner .header-nav .nav-links .nav-link {
    padding: 12px 0;
    font-size: 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    border-top: none;
  }
  .nav-menu-checkbox:checked ~ .header-inner .header-nav .nav-links .nav-link:last-child {
    border-bottom: none;
  }

  .nav-menu-checkbox:checked ~ .header-inner .header-nav .nav-links .btn {
    margin-top: 8px;
    align-self: flex-start;
  }

  .filters-panel {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    border-radius: 0;
    overflow-y: auto;
    padding: 48px 20px 20px;
    box-shadow: none;
  }
  .filters-panel.filters-open { display: block; }
}

/* Connection status badge (Telegram, Email, etc.) */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}
.connection-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.connection-status.cs-connected {
  background: #eafaf1;
  color: #27ae60;
}
.connection-status.cs-disconnected {
  background: #fef9f0;
  color: #e67e22;
}
.connection-status.cs-inactive {
  background: #f5f5f5;
  color: #7f8c8d;
}

/* Telegram widget */
.tg-badge-active {
  color: var(--color-success);
  font-weight: 500;
}
.tg-link-box {
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tg-link-box.hidden { display: none; }
.tg-expire-hint { font-size: 0.85em; }

/* --- Удалённые объявления --- */
.deleted-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(180, 30, 30, 0.82);
  color: #fff;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 0;
  letter-spacing: 0.4px;
  pointer-events: none;
}

.realty-card.is-deleted .card-link {
  pointer-events: none;
  cursor: default;
}
.realty-card.is-deleted {
  opacity: 0.75;
}

.deleted-banner {
  background: #c0392b;
  color: #fff;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}
