:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --ink: #071226;
  --muted: #8a97ad;
  --line: #dfe7f1;
  --blue: #2563eb;
  --green: #059669;
  --red: #ef4444;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 12px 28px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f8fbff 0, var(--bg) 55%);
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
select,
input {
  font: inherit;
}

.shell {
  width: min(1500px, calc(100% - 56px));
  margin: 0 auto;
  padding: 38px 0 56px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(560px, 920px);
  gap: 34px;
  align-items: center;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 18px;
  align-items: center;
}

.brand-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: var(--blue);
  border-radius: 20px;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.2);
}

.brand-icon svg {
  width: 38px;
  fill: #fff;
}

.brand h1 {
  margin: 0;
  text-transform: uppercase;
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.brand h1 span {
  color: var(--blue);
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  min-height: 98px;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid #edf1f6;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  overflow: hidden;
}

.stat small {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.stat strong {
  display: block;
  font-size: clamp(16px, 1.75vw, 24px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  white-space: nowrap;
}

.filters {
  margin: 34px 0 30px;
  padding: 34px 36px;
  background: var(--surface);
  border: 1px solid #edf1f6;
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
}

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

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost-button,
.sort-button,
.clear-button,
.search-button {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ghost-button {
  background: transparent;
  color: #61738e;
  padding-left: 0;
}

.sort-button {
  background: #eff6ff;
  color: var(--blue);
  border: 1px solid #dbeafe;
}

.clear-button {
  background: transparent;
  color: var(--red);
}

.search-button {
  color: #fff;
  background: var(--blue);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.field {
  position: relative;
  display: grid;
  gap: 10px;
}

.field span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.field select,
.multi-trigger {
  width: 100%;
  min-height: 60px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.panel-search::placeholder {
  color: #94a3b8;
}

.multi-trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.multi-panel {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 10px 0 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.multi-panel.open {
  display: block;
}

.panel-search-wrap {
  position: sticky;
  top: -10px;
  z-index: 1;
  padding: 0 10px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 85%, rgba(255, 255, 255, 0.96) 100%);
}

.panel-search {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.option-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.option-row:hover {
  background: #f8fafc;
}

.option-row small {
  margin-left: auto;
  color: #94a3b8;
}

.status {
  padding: 24px;
  color: #64748b;
  text-align: center;
  font-weight: 700;
}

.loading .stat strong,
.loading .multi-trigger,
.loading #filter-uf {
  opacity: 0.7;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.property-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 26px;
  box-shadow: var(--shadow-card);
}

.photo-wrap {
  position: relative;
  height: 286px;
  background: #edf2f7;
}

.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badges {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
}

.badges span {
  padding: 6px 11px;
  border-radius: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.uf-badge {
  background: var(--blue);
}

.discount-badge {
  background: var(--green);
}

.discount-badge:empty {
  display: none;
}

.card-body {
  display: grid;
  gap: 14px;
  padding: 18px 18px 14px;
  flex: 1;
}

.city {
  margin: 0 0 4px;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.modality {
  display: inline-block;
  margin: 0;
  padding: 4px 8px;
  background: #eff6ff;
  color: var(--blue);
  border-radius: 8px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
}

.location {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 14px;
}

.location strong {
  font-size: 11px;
  text-transform: uppercase;
}

.location span,
.description {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.price-box {
  padding: 15px 16px;
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  color: #fff;
  border-radius: 16px;
}

.valuation-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.price-label {
  display: block;
  color: #34d399;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 2px;
}

.price {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.description {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-link {
  display: block;
  margin: 0 18px 18px;
  padding: 13px;
  color: #fff;
  background: var(--blue);
  border-radius: 16px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 980px) {
  .shell {
    width: min(100% - 28px, 1280px);
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .filter-grid,
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1280px);
    padding-top: 18px;
  }

  .brand-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .brand-icon svg {
    width: 30px;
  }

  .brand h1 {
    font-size: 28px;
  }

  .stats-grid,
  .filter-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    padding: 18px;
    border-radius: 18px;
  }

  .field select,
  .multi-trigger,
  .ghost-button,
  .sort-button,
  .clear-button,
  .search-button {
    min-height: 52px;
  }

  .photo-wrap {
    height: 240px;
  }

  .filters-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }
}
