:root {
  --ink: #18212f;
  --muted: #667085;
  --line: #d8dee8;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --navy: #17324d;
  --teal: #0f766e;
  --aqua: #14b8a6;
  --gold: #c8861a;
  --coral: #c94f3d;
  --green: #1f8a5b;
  --shadow: 0 18px 45px rgba(21, 33, 48, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dialog-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 6px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(216, 222, 232, 0.82);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 100px;
  height: 54px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-weight: 800;
  overflow: visible;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  color: #344054;
  font-weight: 700;
  font-size: 0.94rem;
}

.main-nav a {
  padding: 10px 2px;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  border-color: var(--teal);
}

.admin-link {
  color: var(--teal);
}

.whatsapp-top,
.contact-actions a,
.search-panel button,
.form-actions button:first-child,
.login-box button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
}

.whatsapp-top svg,
button svg,
a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 520px;
  padding: clamp(70px, 9vw, 104px) clamp(22px, 5vw, 72px) 52px;
  color: #fff;
  background:
    radial-gradient(circle at 76% 50%, rgba(20, 184, 166, 0.28), transparent 28%),
    linear-gradient(90deg, rgba(10, 24, 40, 0.9), rgba(10, 24, 40, 0.62) 48%, rgba(10, 24, 40, 0.24)),
    url("https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=2200&q=82")
      center/cover;
}

.hero-content {
  max-width: 720px;
  text-align: center;
}

#heroSearch {
  display: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.55rem);
  line-height: 1.06;
  letter-spacing: 0;
  text-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}

.hero p:not(.eyebrow) {
  max-width: 640px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  line-height: 1.6;
}

.search-panel,
.filters,
.property-form,
.admin-list,
.login-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-panel {
  display: grid;
  position: relative;
  gap: 16px;
  padding: 28px 24px 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 252, 0.96)),
    var(--paper);
  border-color: rgba(20, 184, 166, 0.38);
  box-shadow: 0 28px 70px rgba(5, 20, 34, 0.28);
}

.search-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--aqua), #38bdf8);
}

.search-panel::after {
  content: "Busca rápida";
  display: block;
  order: -1;
  color: var(--navy);
  font-size: 1.08rem;
  font-weight: 900;
}

.search-panel label:first-of-type::before {
  content: "Escolha o perfil do imóvel e encontre opções em poucos cliques.";
  display: block;
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.search-panel label span {
  color: #1f3b57;
}

.search-panel input,
.search-panel select {
  min-height: 50px;
  background: #ffffff;
  border-color: rgba(23, 50, 77, 0.22);
}

.search-panel input:focus,
.search-panel select:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.search-panel button {
  min-height: 50px;
  background: linear-gradient(135deg, var(--teal), var(--green));
  box-shadow: 0 12px 24px rgba(31, 138, 91, 0.22);
}

.search-panel button:hover {
  filter: brightness(1.05);
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 0.8rem;
  font-weight: 800;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  background: #f9fbfd;
  border: 1px solid #c9d2df;
  border-radius: var(--radius);
}

.check-field input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.check-field span {
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9d2df;
  border-radius: var(--radius);
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="file"] {
  padding: 9px;
}

.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.upload-preview img {
  width: 92px;
  height: 70px;
  object-fit: cover;
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.preview-item {
  position: relative;
  display: inline-block;
}

.preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  color: #fff;
  background: #dc2626;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.preview-remove:hover {
  background: #b91c1c;
}

.preview-remove svg {
  width: 14px;
  height: 14px;
}

.gallery-preview img {
  width: 78px;
  height: 58px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 1180px;
  margin: -28px auto 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(21, 33, 48, 0.1);
}

.stats-strip article {
  display: grid;
  place-items: center;
  min-height: 112px;
  padding: 24px 20px;
  background: #fff;
  text-align: center;
}

.stats-strip article + article {
  border-left: 1px solid var(--line);
}

.stats-strip strong,
.stats-strip span {
  display: block;
}

.stats-strip strong {
  color: var(--navy);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.15;
}

.stats-strip span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.featured-section,
.catalog-section,
.contact-section,
.admin-section {
  padding: clamp(52px, 7vw, 88px) clamp(18px, 4vw, 56px);
}

.featured-section {
  background: #fff;
}

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

.featured-card {
  overflow: hidden;
  background: #101928;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.featured-card button {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(280px, 26vw, 360px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.featured-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  transition: transform 180ms ease, opacity 180ms ease;
}

.featured-card:hover img {
  transform: scale(1.03);
  opacity: 0.68;
}

.featured-card .badge {
  position: absolute;
  top: 14px;
  left: 14px;
}

.featured-card div {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 6px;
  padding: 54px 18px 18px;
  background: linear-gradient(180deg, transparent, rgba(16, 25, 40, 0.94));
}

.featured-card strong,
.featured-card small,
.featured-card span:not(.badge) {
  display: block;
}

.featured-card strong {
  font-size: 1.1rem;
  line-height: 1.25;
}

.featured-card small {
  color: rgba(255, 255, 255, 0.76);
}

.featured-card span:not(.badge) {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.admin-page h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
}

.admin-page {
  min-height: calc(100vh - 76px);
}

h3 {
  margin: 0;
}

.view-actions {
  display: inline-flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.icon-button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.12), rgba(255, 255, 255, 0.96) 34%),
    var(--paper);
  border-color: rgba(20, 184, 166, 0.32);
  box-shadow: 0 18px 42px rgba(15, 118, 110, 0.12);
}

.filters::before {
  content: "";
  display: block;
  height: 5px;
  margin: -18px -18px 2px;
  background: linear-gradient(90deg, var(--teal), var(--aqua), #38bdf8);
}

.filter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.filter-title h3 {
  color: var(--navy);
}

.filters label span {
  color: #29415c;
}

.filters input,
.filters select {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(23, 50, 77, 0.2);
}

.filters input:focus,
.filters select:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.filter-title button,
.form-actions button,
.admin-tools button,
.import-button,
.card-actions button,
.admin-card button,
.dialog-close,
#newProperty {
  min-height: 40px;
  padding: 0 12px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
}

.results-bar strong {
  color: var(--ink);
}

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

.property-grid.list {
  grid-template-columns: 1fr;
}

.property-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.property-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.property-card.list-card {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  align-items: start;
  min-height: 0;
}

.property-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #dce3eb;
  text-align: left;
}

.property-media .media-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.list-card .property-media {
  height: 188px;
  min-height: 0;
  aspect-ratio: auto;
  margin: 16px 0 16px 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: #fff;
  background: rgba(16, 25, 40, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  opacity: 1;
  transform: translateY(-50%);
  transition: opacity 160ms ease, background 160ms ease;
}

.carousel-button.prev {
  left: 10px;
}

.carousel-button.next {
  right: 10px;
}

.carousel-button:hover {
  background: rgba(16, 25, 40, 0.9);
}

.carousel-button svg {
  width: 18px;
  height: 18px;
}

.carousel-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  padding: 5px 8px;
  color: #fff;
  background: rgba(16, 25, 40, 0.78);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.badge-row {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 6px 9px;
  color: #fff;
  background: var(--navy);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.badge.rent {
  background: var(--teal);
}

.badge.code {
  background: var(--coral);
}

.property-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.list-card .property-body {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  align-content: center;
  column-gap: 24px;
  row-gap: 14px;
  padding: 18px 22px;
}

.property-body h3 {
  font-size: 1.05rem;
  line-height: 1.28;
}

.list-card .property-body h3 {
  max-width: 680px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.list-card .property-body > div:first-child,
.list-card .metrics {
  grid-column: 1;
}

.list-card .property-body > div:nth-child(2) {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  padding: 14px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.list-card .card-actions {
  grid-column: 2;
  align-self: end;
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.93rem;
}

.price {
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 900;
}

.list-card .price {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.fees {
  color: var(--muted);
  font-size: 0.84rem;
}

.metrics,
.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metrics span,
.feature-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  background: #eef3f7;
  border-radius: var(--radius);
  color: #344054;
  font-size: 0.84rem;
  font-weight: 750;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.property-card-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list-card .card-actions:not(.property-card-actions) {
  grid-template-columns: 1fr;
}

.card-actions a,
.card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border-radius: var(--radius);
  font-weight: 850;
}

.card-actions a {
  color: #fff;
  background: var(--green);
}

.property-card-actions .whatsapp-contact-action {
  grid-column: 1 / -1;
  padding-inline: 10px;
  white-space: nowrap;
  line-height: 1.2;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 260px;
  padding: 34px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.empty-state svg {
  width: 42px;
  height: 42px;
  color: var(--gold);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.contact-section p {
  color: var(--muted);
  line-height: 1.6;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.94), rgba(23, 50, 77, 0.86)),
    #050505;
  color: #fff;
}

.contact-section p {
  color: rgba(255, 255, 255, 0.78);
}

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

.contact-details {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.86);
}

.contact-details span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1.35;
}

.contact-details svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex: 0 0 auto;
}

.contact-actions a:last-child {
  background: var(--gold);
}

.admin-section {
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.18), transparent 34rem),
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.14), transparent 24rem),
    linear-gradient(180deg, #eef5f8 0%, #f8fafc 100%);
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-hero h1 {
  margin: 0;
}

.admin-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-hero #newProperty {
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 12px 24px rgba(23, 50, 77, 0.18);
}

.login-box {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 16px;
  width: min(1080px, 100%);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 252, 0.96)),
    var(--paper);
  border-color: rgba(20, 184, 166, 0.28);
  box-shadow: 0 24px 60px rgba(15, 35, 52, 0.13);
}

.login-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.login-card-header strong,
.login-card-header small {
  display: block;
}

.login-card-header strong {
  color: var(--navy);
  font-size: 1rem;
  font-weight: 900;
}

.login-card-header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.login-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--aqua));
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.24);
}

.login-icon svg {
  width: 22px;
  height: 22px;
}

.login-box label span {
  color: #1f3b57;
}

.login-box input {
  min-height: 48px;
  background: #fff;
  border-color: rgba(23, 50, 77, 0.22);
}

.login-box input:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.login-box button {
  min-height: 48px;
  background: linear-gradient(135deg, var(--teal), var(--green));
  box-shadow: 0 12px 24px rgba(31, 138, 91, 0.2);
  white-space: nowrap;
}

.login-box button:hover {
  filter: brightness(1.05);
}

.admin-workspace {
  display: grid;
  gap: 18px;
}

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

.admin-summary article {
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(21, 33, 48, 0.08);
}

.admin-summary span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.admin-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1;
}

.property-form,
.admin-list {
  padding: 22px;
}

.form-header,
.form-actions,
.admin-tools,
.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

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

.wide {
  grid-column: span 2;
}

.form-actions {
  justify-content: flex-start;
  margin: 18px 0 0;
}

.admin-tools {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.admin-tools button,
.import-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-list-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-list-header #newProperty {
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 10px 20px rgba(23, 50, 77, 0.16);
}

.admin-list-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.admin-list-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-search {
  display: block;
  margin-bottom: 18px;
}

.admin-search input {
  min-height: 52px;
  font-size: 1rem;
  background: #f9fbfd;
}

.admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.admin-card:first-child {
  border-top: 0;
}

.admin-card p {
  margin: 7px 0 0;
  color: var(--muted);
}

.admin-card small {
  display: block;
  margin-top: 6px;
  color: #77839a;
  font-weight: 650;
}

.admin-card-main {
  min-width: 0;
}

.admin-card-main strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.28;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: #fff;
  background: var(--muted);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.admin-status.published {
  background: var(--green);
}

.admin-status.draft {
  background: var(--gold);
}

.admin-status.featured {
  margin-left: 6px;
  background: var(--coral);
}

.admin-empty {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.admin-empty p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.property-dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.admin-form-dialog {
  width: min(1180px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  background: #fff;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.admin-form-dialog::backdrop {
  background: rgba(11, 18, 32, 0.62);
}

.admin-form-dialog .property-form {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.admin-form-dialog .form-header {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -22px -22px 18px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.inline-close {
  position: static;
  width: 42px;
  flex: 0 0 auto;
}

.property-dialog::backdrop {
  background: rgba(11, 18, 32, 0.62);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
}

.dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  max-height: calc(100vh - 24px);
}

.dialog-gallery {
  position: relative;
  min-height: min(620px, calc(100vh - 24px));
  overflow: hidden;
  background: #101928;
}

.dialog-gallery img {
  width: 100%;
  height: 100%;
  min-height: min(620px, calc(100vh - 24px));
  object-fit: cover;
}

.dialog-gallery .carousel-button {
  opacity: 1;
}

.dialog-carousel-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
}

.dialog-carousel-counter {
  right: 14px;
  bottom: 14px;
}

.dialog-info {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 34px;
}

.dialog-info h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.14;
}

.dialog-info p {
  color: var(--muted);
  line-height: 1.65;
}

.dialog-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialog-location {
  margin: -4px 0 0;
  font-size: 1rem;
}

.dialog-price {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 10px 14px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.dialog-metrics,
.dialog-features {
  margin-top: -2px;
}

.dialog-description {
  margin: 0;
  padding: 14px 16px;
  background: #f8fafc;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
}

.dialog-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2px;
}

.social-preview-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.social-preview-dialog::backdrop {
  background: rgba(11, 18, 32, 0.62);
}

.social-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.social-preview-header span,
.social-preview-text small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.social-preview-header strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.2rem;
}

.social-preview-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.social-preview-body img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dce3eb;
  border-radius: var(--radius);
}

.social-preview-text {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.social-preview-text pre {
  min-height: 180px;
  max-height: 280px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #24364d;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  line-height: 1.5;
}

.social-preview-text a {
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
}

.social-preview-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

.social-preview-actions button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 850;
  cursor: pointer;
}

.social-preview-actions button:first-child {
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
}

.social-preview-actions button:last-child {
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  color: rgba(255, 255, 255, 0.78);
  background: #101928;
}

.site-footer span {
  display: block;
}

.site-footer a {
  color: #fff;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-card button {
    height: 320px;
  }

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

  .property-card.list-card {
    grid-template-columns: 228px minmax(0, 1fr);
  }

  .list-card .property-media {
    height: 188px;
  }

  .list-card .property-body {
    grid-template-columns: 1fr;
  }

  .list-card .property-body > div:first-child,
  .list-card .property-body > div:nth-child(2),
  .list-card .metrics,
  .list-card .card-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .list-card .card-actions,
  .property-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .wide {
    grid-column: span 2;
  }
}

@media (hover: none) {
  .carousel-button {
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .catalog-layout,
  .contact-section,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .dialog-gallery,
  .dialog-gallery img {
    min-height: 280px;
    max-height: 48vh;
  }

  .dialog-info {
    padding: 22px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .social-preview-body,
  .social-preview-actions {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: stretch;
    min-height: auto;
    padding-top: 56px;
    padding-bottom: 28px;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 10vw, 3.35rem);
  }

  .search-panel {
    padding: 20px;
  }

  .filters {
    position: static;
  }

  .stats-strip {
    grid-template-columns: 1fr;
    margin-top: -18px;
    width: calc(100% - 32px);
  }

  .stats-strip article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .section-heading,
  .results-bar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-hero #newProperty {
    width: 100%;
  }

  .admin-summary {
    grid-template-columns: 1fr;
  }

  .admin-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-card-actions {
    justify-content: flex-start;
  }

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

  .login-card-header {
    grid-column: 1 / -1;
  }

  .login-box button {
    width: 100%;
  }

  .property-card.list-card {
    grid-template-columns: 1fr;
  }

  .list-card .property-media {
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 0;
    border-radius: 0;
    min-height: 0;
  }

  .list-card .property-body {
    padding: 18px;
  }
}

@media (max-width: 620px) {
  .whatsapp-top {
    width: 100%;
  }

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

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

  .featured-card button {
    height: 300px;
  }

  .login-box,
  .form-grid,
  .two-cols,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .login-box {
    padding: 18px;
  }

  .login-card-header {
    align-items: flex-start;
  }

  .admin-section {
    padding-inline: 14px;
  }

  .admin-list,
  .property-form {
    padding: 16px;
  }

  .admin-form-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .admin-form-dialog .form-header {
    margin: -16px -16px 16px;
    padding: 14px 16px;
  }

  .admin-card-actions button {
    flex: 1 1 120px;
  }

  .wide {
    grid-column: span 1;
  }

  .contact-actions,
  .contact-actions a,
  .form-actions,
  .form-actions button,
  .admin-tools button,
  .import-button {
    width: 100%;
  }
}
