:root {
  --bg: #e7ece8;
  --bg-deep: #d5ddd6;
  --ink: #14201c;
  --muted: #5b6a63;
  --accent: #1f4d3f;
  --accent-2: #c4a35a;
  --card: #f4f7f4;
  --line: rgba(20, 32, 28, 0.12);
  --danger: #8f2d2d;
  --ok: #1f4d3f;
  --shadow: 0 18px 40px rgba(20, 32, 28, 0.08);
  --radius: 15px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(196, 163, 90, 0.14), transparent 42%),
    linear-gradient(180deg, #eef2ef 0%, var(--bg) 45%, #dde5df 100%);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 0.6rem; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 2rem)); }
.center { text-align: center; }
.mt-lg { margin-top: 2rem; }
.muted { color: var(--muted); }
.empty { padding: 2rem 0; color: var(--muted); }

.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(231, 236, 232, 0.86);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.brand {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--ink); font-weight: 500; text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav-admin { color: var(--accent) !important; }

.hero {
  position: relative;
  min-height: 50vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f3f7f4;
}
.hero-media {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    linear-gradient(120deg, rgba(10, 18, 15, 0.52) 12%, rgba(10, 18, 15, 0.12) 55%, rgba(10, 18, 15, 0.28) 100%),
    url("../img/realty-city-hero-v4.png") center/cover no-repeat;
  transform: scale(1.02);
  animation: heroDrift 18s ease-in-out infinite alternate;
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.5rem;
  max-width: 760px;
  animation: riseIn 0.9s ease both;
}
.brand-hero {
  font-size: clamp(3rem, 8vw, 5.5rem);
  margin-bottom: 0.8rem;
  color: #f7faf7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: #d9c38a;
  margin: 0 0 0.8rem;
}
.lead {
  font-size: 1.65rem;
  max-width: none;
  color: #dce6e0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.75rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #f4f8f5; }
.btn-primary:hover { background: #16392f; color: #fff; }
.btn-secondary { background: transparent; border-color: currentColor; color: inherit; }
.hero .btn-primary,
.hero .btn-secondary {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
}
.hero .btn-primary:hover,
.hero .btn-secondary:hover {
  background: #f4f8f5;
  color: #16392f;
  border-color: #f4f8f5;
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger, .danger { color: var(--danger) !important; }
.btn-danger { background: #f7e8e8; border-color: #e4bcbc; }

.section { padding: 3.5rem 0; }
.section-muted { background: rgba(255,255,255,0.35); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 1.6rem; max-width: 40rem; }

.property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.property-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: riseIn .7s ease both;
}
.property-card-media { display: block; aspect-ratio: 4/3; overflow: hidden; background: #1a2a24; }
.property-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.property-card:hover .property-card-media img { transform: scale(1.04); }
.property-card-body { padding: 1rem 1rem 1.2rem; }
.property-card h3 { font-size: 1.45rem; margin: 0.35rem 0; }
.property-card h3 a { color: inherit; text-decoration: none; }
.price { font-weight: 700; font-size: 1.15rem; margin: 0.35rem 0; }
.meta-row { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.tag, .badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(31, 77, 63, 0.1);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}
.tag-deal {
  background: rgba(196, 163, 90, 0.18);
  color: #7a6230;
}
.badge-on { background: rgba(31,77,63,.12); color: var(--ok); }
.badge-off { background: rgba(143,45,45,.1); color: var(--danger); }

.purpose-row { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }
.purpose-chip {
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
}
.purpose-chip:hover { border-color: var(--accent); color: var(--accent); }

.filters, .admin-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.4rem;
  padding: 1rem;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--line);
}
.filters label, .admin-form label, .stack label, .auth-card label {
  display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem;
}
.filters-actions {
  display: flex;
  align-items: flex-end;
  align-self: end;
  gap: 0.5rem;
}
.btn-sm {
  width: auto;
  min-height: 2.35rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
.admin-filters .filters-actions .btn-sm {
  min-width: 5.5rem;
}
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
}
textarea { resize: vertical; }

.property-show {
  display: grid;
  gap: 1rem;
}
.property-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.55fr);
  gap: 1.4rem;
  align-items: start;
}
.property-main {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.property-sidebar {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}
.property-info {
  max-width: none;
}
.property-info .tag {
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
}
.property-info h1 {
  margin-top: 0.2rem;
  margin-bottom: 0.55rem;
}
.property-info .description {
  margin-top: 0;
}
.admin-edit-link {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
}
.admin-edit-link a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.admin-edit-link a:hover {
  color: #16392f;
}
.about-page h2 {
  margin-top: 1.8rem;
  margin-bottom: 0.7rem;
}
.about-page p,
.about-page li {
  margin-bottom: 0.85rem;
}
.about-page ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}
.lead-about {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.contact-box,
.property-summary,
.share-box {
  margin-top: 0;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  overflow: hidden;
}
.share-box h2 {
  font-size: 1.4rem;
  margin-bottom: 0.85rem;
}
.share-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease;
  flex: 0 0 44px;
  transform-origin: center center;
}
.share-icon:hover {
  transform: scale(1.2);
  text-decoration: none;
  background: transparent;
}
.share-icon:focus,
.share-icon:focus-visible {
  outline: none;
  box-shadow: none;
}
.share-icon img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px;
  max-height: 40px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 10px;
  background: transparent;
}
.share-max img {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px;
  max-height: 42px;
}
.share-native {
  font: inherit;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  background: #1f4d3f !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  outline: none !important;
}
.share-native img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  filter: brightness(0) invert(1);
}
.share-native:hover {
  background: #16392f !important;
}
.share-hint {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--accent);
}
.related-block {
  margin-top: 4.6rem;
}
.related-block h2 {
  margin-bottom: 1rem;
}
.contact-box {
  position: static;
}
.property-summary {
  position: static;
}
.summary-list {
  margin: 0;
  display: grid;
  gap: 0;
}
.summary-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.summary-list > div:first-child {
  padding-top: 0;
}
.summary-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.summary-list dt {
  font-size: 0.9rem;
  color: var(--muted);
  flex: 0 1 auto;
}
.summary-list dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
  text-align: right;
}
.contact-box h2 {
  font-size: 1.55rem;
  margin-bottom: 0.7rem;
}
.contact-phone {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 1rem;
}
.contact-phone:hover {
  color: var(--accent);
}
.contact-actions {
  display: grid;
  gap: 0.55rem;
}
.contact-box .btn {
  margin-top: 0;
  width: 100%;
}
.contact-whatsapp {
  border-color: #25d366;
  color: #128c7e;
}
.contact-whatsapp:hover {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}
.contact-telegram {
  border-color: #2aabee;
  color: #229ed9;
}
.contact-telegram:hover {
  background: #2aabee;
  border-color: #2aabee;
  color: #fff;
}
.gallery { display: grid; gap: 0.45rem; }
.gallery-main-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a2a24;
}
.gallery-main-btn {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;
  cursor: zoom-in;
}
.gallery-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.gallery-zoom {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
.gallery-main-btn:hover .gallery-zoom {
  background: #fff;
  color: #16392f;
}
.gallery-thumbs-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
}
.gallery-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.gallery-thumbs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.gallery-thumb {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a2a24;
  cursor: pointer;
  display: block;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb.is-active {
  border-color: var(--accent);
}
.gallery-thumb:hover {
  border-color: rgba(31, 77, 63, 0.55);
}
.gallery-nav {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.gallery-nav:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.gallery-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.gallery-nav:disabled:hover {
  background: #fff;
  color: var(--accent);
  border-color: var(--line);
}
.specs { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.45rem; }
.description { margin-top: 1rem; white-space: normal; }

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: #14201c;
  color: #d7e0db;
  padding: 2.5rem 0;
}
.site-footer a { color: #d7e0db; display: block; margin: 0.25rem 0; }
.brand-footer { color: #f4f7f4; margin-bottom: 0.6rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 1.5rem; align-items: start; }
.footer-qr img {
  width: 120px;
  height: 120px;
  display: block;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
}
.footer-qr a {
  display: inline-block;
  margin: 0;
}
.footer-copy {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.6rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(215, 224, 219, 0.18);
  text-align: center;
  color: #b7c4bd;
  font-size: 0.92rem;
}
.footer-copy a {
  display: inline;
  margin: 0;
  color: #d9c38a;
  text-decoration: underline;
}
.footer-copy a:hover {
  color: #f0dfad;
}
.footer-messengers {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.85rem;
}
.messenger-link {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}
.messenger-whatsapp {
  background: #25d366;
  color: #fff !important;
}
.messenger-telegram {
  background: #2aabee;
  color: #fff !important;
}
.messenger-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.flash {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}
.flash-success { border-color: rgba(31,77,63,.3); background: #e8f2ec; }
.flash-error { border-color: rgba(143,45,45,.3); background: #f8ecec; }

.pagination { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 1.5rem; }
.pagination a {
  min-width: 2.2rem; text-align: center;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.admin-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  background: #e9eee9;
}
.admin-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #14201c;
  color: #f5f8f5;
  position: sticky;
  top: 0;
  z-index: 30;
}
.admin-topbar .brand {
  color: #f5f8f5;
  font-size: 1.25rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-site {
  color: #c4a35a;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.admin-nav-toggle {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.admin-nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: #f5f8f5;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
body.admin-nav-open .admin-nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.admin-nav-open .admin-nav-toggle span:nth-child(2) {
  opacity: 0;
}
body.admin-nav-open .admin-nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.admin-backdrop {
  display: none;
}
.admin-aside {
  background: #14201c;
  color: #dce5e0;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-aside .brand { color: #f5f8f5; }
.admin-aside nav { display: flex; flex-direction: column; gap: 0.55rem; }
.admin-aside a { color: #dce5e0; text-decoration: none; }
.admin-aside a:hover { color: #c4a35a; }
.admin-main { padding: 1.5rem; min-width: 0; }
.admin-page h1 { margin-bottom: 1rem; }
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-only { display: none !important; }
.desktop-only { display: block; }
.admin-cards {
  display: grid;
  gap: 0.85rem;
}
.admin-cards.mobile-only {
  display: none !important;
}
.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}
.admin-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.admin-card-id {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.admin-card-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.admin-card-city {
  margin: 0;
}
.admin-card-price {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.admin-card-status {
  margin: 0.1rem 0 0.15rem;
}
.admin-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.92rem;
}
.admin-card-actions {
  margin-top: 0.25rem;
  width: 100%;
}
.admin-card-actions .btn-action,
.admin-card-actions form {
  width: 100%;
}
.admin-card > .btn {
  width: 100%;
}
.table .link-action {
  display: inline;
  font-weight: 600;
  white-space: nowrap;
}
.table .col-open {
  width: 6rem;
  white-space: nowrap;
}
.admin-card-property .admin-card-title,
.admin-card-property .admin-card-city,
.admin-card-property .admin-card-price,
.admin-card-property .admin-card-status {
  width: 100%;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.stat, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.stat span { color: var(--muted); display: block; }
.stat strong { font-size: 2rem; font-family: var(--font-display); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; table-layout: auto; }
.table th, .table td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: break-word;
}
.table-stats { max-width: 420px; }
.table-stats th:nth-child(1),
.table-stats td:nth-child(1) { width: 60%; }
.table-stats th:nth-child(2),
.table-stats td:nth-child(2) { width: 40%; }
.table-properties .col-id {
  width: 3.2rem;
  white-space: nowrap;
  word-break: normal;
}
.table-properties .col-actions {
  width: 10.5rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.actions form { display: inline; }
.actions button:not(.btn) {
  background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline;
}
.actions-stack {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem;
}
.actions-stack form {
  display: block;
  margin: 0;
  width: 100%;
}
.actions-stack .btn-action {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.actions-stack button.btn-action {
  text-decoration: none;
}
.admin-form, .stack { background: #fff; border: 1px solid var(--line); padding: 1.1rem; border-radius: var(--radius); }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
  align-items: start;
}
.form-grid > label {
  min-width: 0;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 2.6rem;
}
.form-grid textarea {
  min-height: 10rem;
}
.span-2 { grid-column: span 2; }
.checkbox { flex-direction: row !important; align-items: center; gap: 0.55rem !important; }
.checkbox input { width: auto; }
.check-group {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}
.check-group legend {
  padding: 0 0.35rem;
  font-weight: 600;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 0.8rem;
  margin-top: 0.35rem;
}
@media (max-width: 640px) {
  .check-grid { grid-template-columns: 1fr 1fr; }
}
.form-actions { display: flex; gap: 0.7rem; margin-top: 1rem; flex-wrap: wrap; }
.admin-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.admin-image { border: 1px solid var(--line); padding: 0.5rem; background: #f8faf8; }
.admin-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: 0.5rem; }
.admin-image-actions { display: flex; flex-direction: column; gap: 0.35rem; }
.admin-image-actions button {
  background: none; border: none; color: var(--accent); cursor: pointer; text-align: left; padding: 0;
}
.danger-zone { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.logout-form { margin-top: auto; }
.logout-form .btn { width: 100%; color: #dce5e0; border-color: rgba(255,255,255,.2); }

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 80% 10%, rgba(196,163,90,.18), transparent 35%),
    linear-gradient(160deg, #1a2a24, #0f1714 60%, #243830);
}
.auth-card {
  width: min(420px, 100%);
  background: #f4f7f4;
  padding: 1.6rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.8rem; margin: 0.8rem 0 1rem; }
.auth-card .stack { border: none; padding: 0; background: transparent; }
.password-field {
  position: relative;
  display: block;
}
.password-field input {
  width: 100%;
  padding-right: 2.8rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.password-toggle:hover {
  color: var(--accent);
  background: rgba(31, 77, 63, 0.08);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroDrift {
  from { transform: scale(1.02) translate3d(0,0,0); }
  to { transform: scale(1.06) translate3d(-1.5%, -1%, 0); }
}

@media (max-width: 960px) {
  .property-grid, .stat-grid, .admin-images, .footer-grid, .filters, .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .property-top { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 2; }
  .admin-body {
    grid-template-columns: 1fr;
  }
  .admin-topbar { display: flex; }
  .admin-aside {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  body.admin-nav-open .admin-aside {
    transform: none;
  }
  body.admin-nav-open {
    overflow: hidden;
  }
  .admin-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(8, 14, 12, 0.5);
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .admin-backdrop[hidden] {
    display: none !important;
  }
  .admin-main {
    padding: 1rem;
  }
  .check-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-content {
    padding: 3.2rem 0 2.4rem;
  }
  .gallery-thumb {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .header-inner {
    flex-wrap: wrap;
    align-items: center;
  }
  .brand {
    flex: 1;
    min-width: 0;
    font-size: 1.35rem;
  }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 0.35rem 0 0.55rem;
  }
  body.nav-open .nav {
    display: flex;
  }
  body.nav-open {
    overflow: hidden;
  }
  .nav a {
    display: block;
    padding: 0.75rem 0.2rem;
    border-top: 1px solid var(--line);
    font-size: 1.05rem;
  }
}

@media (max-width: 640px) {
  .container,
  .narrow {
    width: calc(100% - 1.25rem);
  }
  .property-grid,
  .stat-grid,
  .admin-images,
  .footer-grid,
  .filters,
  .admin-filters,
  .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }
  .span-2 { grid-column: span 1; }
  .section { padding: 2.2rem 0; }
  .hero {
    min-height: 58vh;
  }
  .hero-media {
    background:
      linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
      linear-gradient(120deg, rgba(10, 18, 15, 0.52) 12%, rgba(10, 18, 15, 0.12) 55%, rgba(10, 18, 15, 0.28) 100%),
      url("../img/realty-city-hero-v4.png") center/cover no-repeat;
  }
  .hero-content {
    padding: 2.4rem 0 2rem;
    max-width: none;
  }
  .brand-hero {
    font-size: clamp(2.35rem, 12vw, 3.4rem);
  }
  .lead {
    white-space: normal;
    font-size: 1.25rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .filters,
  .admin-filters {
    padding: 0.85rem;
    gap: 0.7rem;
  }
  .filters-actions {
    width: 100%;
  }
  .filters-actions .btn,
  .admin-filters .filters-actions .btn-sm {
    width: 100%;
    min-width: 0;
  }
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-head .btn {
    width: 100%;
  }
  .property-card h3 {
    font-size: 1.25rem;
  }
  .property-info h1 {
    font-size: clamp(1.7rem, 8vw, 2.3rem);
  }
  .summary-list > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .summary-list dd {
    text-align: left;
  }
  .share-icons {
    justify-content: flex-start;
  }
  .related-block {
    margin-top: 2.4rem;
  }
  .footer-grid {
    gap: 1.2rem;
  }
  .footer-copy {
    padding-inline: 0.75rem;
    font-size: 0.85rem;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn {
    width: 100%;
  }
  .admin-form,
  .stack {
    padding: 0.9rem;
  }
  .table th,
  .table td {
    padding: 0.55rem 0.35rem;
    font-size: 0.92rem;
  }
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .admin-cards.mobile-only { display: grid !important; }
  .table-properties {
    min-width: 0;
  }
  .table-properties .col-type,
  .table-properties .col-views {
    display: none;
  }
  .table-properties .col-actions {
    width: 8.5rem;
  }
  .actions-stack .btn-action {
    font-size: 0.9rem;
    padding: 0.55rem 0.7rem;
    min-height: 2.5rem;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .pagination {
    gap: 0.3rem;
  }
  .pagination a {
    min-width: 2.4rem;
    min-height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .lightbox__close {
    top: 0.6rem;
    right: 0.6rem;
  }
  .lightbox__image {
    max-width: calc(100vw - 1.2rem);
    max-height: calc(100vh - 5rem);
  }
  .lightbox__prev { left: 0.35rem; }
  .lightbox__next { right: 0.35rem; }
  .confirm-modal__actions {
    flex-direction: column-reverse;
  }
  .confirm-modal__actions .btn {
    width: 100%;
  }
  .gallery-thumbs-wrap {
    gap: 0.3rem;
  }
  .gallery-nav {
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
  }
  .purpose-chip {
    flex: 1 1 calc(50% - 0.7rem);
    text-align: center;
  }
}

@media (max-width: 420px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .purpose-chip {
    flex: 1 1 100%;
  }
  .admin-images {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media {
    animation: none;
  }
  .property-card,
  .hero-content {
    animation: none;
  }
}

body.modal-open { overflow: hidden; }
.confirm-modal[hidden] { display: none !important; }
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 15, 0.55);
}
.confirm-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem;
}
.confirm-modal__dialog h3 {
  margin: 0 0 0.5rem;
  font-size: 1.55rem;
}
.confirm-modal__dialog p {
  margin: 0 0 1.2rem;
  color: var(--muted);
}
.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

body.lightbox-open { overflow: hidden; }
.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 12, 0.88);
}
.lightbox__image {
  position: relative;
  z-index: 1;
  max-width: min(1100px, calc(100vw - 6rem));
  max-height: calc(100vh - 4rem);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  font-size: 1.8rem;
  line-height: 1;
}
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox__close:hover,
.lightbox__nav:hover {
  background: #fff;
}
.lightbox__counter {
  position: absolute;
  z-index: 2;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #f4f8f5;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
}
