:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e1e8;
  --paper: #ffffff;
  --soft: #f3f7f5;
  --green: #116149;
  --green-dark: #0d4636;
  --green-soft: #e7f3ee;
  --gold: #c58b2b;
  --gold-soft: #fff6e6;
  --blue: #255f85;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(23, 32, 42, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f7faf9;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
main { min-height: calc(100vh - 156px); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 5vw;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(23, 32, 42, .04);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 800; font-size: 1.35rem; color: var(--green); white-space: nowrap; }
.brand span { color: var(--gold); }
.site-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a, .site-nav button { border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; padding: 9px 10px; border-radius: 6px; }
.site-nav a:hover, .site-nav button:hover { background: var(--green-soft); color: var(--green); }
.site-nav form { margin: 0; }
.menu-toggle { display: none; width: 42px; height: 42px; padding: 9px; border-radius: 6px; border: 1px solid var(--line); background: white; }
.menu-toggle span { display: block; height: 2px; margin: 5px 0; background: var(--green); }

.nav-cta, .btn, button {
  border-radius: 6px;
  padding: 10px 16px;
  border: 1px solid var(--green);
  background: var(--paper);
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}
.btn.primary, button[type="submit"], .nav-cta {
  background: var(--green);
  color: white;
  box-shadow: 0 10px 22px rgba(17, 97, 73, .18);
}
.btn.primary:hover, button[type="submit"]:hover, .nav-cta:hover { background: var(--green-dark); }
.btn.secondary { border-color: var(--gold); color: var(--gold); background: white; }
.btn.secondary:hover { background: var(--gold-soft); }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(17, 97, 73, .12);
  border-color: var(--green);
}
label { font-weight: 800; font-size: .9rem; color: #21313c; }
.field { display: grid; gap: 7px; min-width: 0; }
.field small, .helptext { color: var(--muted); font-size: .8rem; }
.errorlist { margin: 6px 0 0; padding: 0; list-style: none; color: var(--danger); font-weight: 700; font-size: .86rem; }

.section, .listing-page, .dashboard, .content-page, .property-detail { padding: 56px 5vw; }
.section, .listing-page, .dashboard, .content-page, .property-detail, .property-form-page { overflow-x: clip; }
.muted { background: var(--soft); }
.section-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 22px; }
.section-head h1, .section-head h2, .dashboard h1, .content-page h1 { margin: 0; }
.eyebrow, .property-meta {
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: .78rem;
}

.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 40px;
  align-items: center;
  padding: 7vw 5vw;
  background: radial-gradient(circle at top right, rgba(37, 95, 133, .14), transparent 30%), linear-gradient(135deg, #eaf4ef 0%, #ffffff 52%, #edf5f8 100%);
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: 1; margin: 8px 0 18px; }
.hero p { max-width: 680px; font-size: 1.08rem; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.search-panel, .inquiry-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.search-panel { display: grid; gap: 12px; }

.property-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.property-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(23, 32, 42, .06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.property-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.property-media { position: relative; aspect-ratio: 4 / 3; background: #dde8e4; display: block; }
.property-media img { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--green);
  font-weight: 800;
  font-size: .78rem;
}
.image-placeholder { height: 100%; display: grid; place-items: center; color: var(--green); font-weight: 800; }
.property-body { padding: 16px; display: grid; gap: 8px; }
.property-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.property-body p { color: var(--muted); margin: 0; }
.property-body strong, .price { color: var(--green); font-size: 1.2rem; }
.property-body strong span { color: var(--muted); font-size: .86rem; font-weight: 700; }
.card-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.card-facts span { padding: 5px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .78rem; font-weight: 700; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.category-tile { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 18px; min-height: 120px; box-shadow: 0 8px 22px rgba(23, 32, 42, .04); }
.category-tile span { color: var(--muted); display: block; margin-top: 8px; }
.text-panel {
  max-width: 860px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 10px 26px rgba(23, 32, 42, .05);
}
.text-panel p { margin-top: 0; color: var(--muted); font-size: 1.02rem; }
.text-panel p:last-child { margin-bottom: 0; }

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 26px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 32, 42, .05);
}
.filters button { width: 100%; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: white; }

.auth-shell {
  min-height: calc(100vh - 130px);
  display: grid;
  place-items: center;
  padding: 56px 5vw;
  background: radial-gradient(circle at top left, rgba(17, 97, 73, .14), transparent 35%), linear-gradient(180deg, #f8fbfa, #eef5f2);
}
.auth-card {
  width: min(100%, 460px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.auth-card.wide { width: min(100%, 860px); }
.auth-card h1 { margin: 4px 0 18px; font-size: clamp(2rem, 4vw, 3rem); }
.form-card { display: grid; gap: 14px; }
.form-card p, .profile-form p, .inquiry-box p { margin: 0; display: grid; gap: 7px; }
.form-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-card-grid p:last-of-type, .form-card-grid button { grid-column: span 2; }
.social-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 16px;
}
.social-login::before {
  content: "G";
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  font-weight: 800;
}
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 0 0 16px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.profile-edit-page, .content-page { max-width: 1180px; margin: 0 auto; }
.profile-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.profile-form p:has(textarea), .profile-form button { grid-column: span 3; }
.profile-head { padding: 56px 5vw; display: flex; gap: 24px; align-items: center; background: var(--soft); }
.profile-head img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 4px solid white; box-shadow: var(--shadow); }

.property-form-page { padding: 42px 5vw 64px; background: radial-gradient(circle at top left, rgba(17, 97, 73, .12), transparent 32%), linear-gradient(180deg, #f8fbfa 0%, #eef5f2 100%); min-height: calc(100vh - 80px); }
.form-hero { max-width: 1240px; margin: 0 auto 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.form-hero h1 { margin: 4px 0 8px; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; }
.form-hero p { max-width: 760px; color: var(--muted); margin: 0; }
.property-form { max-width: 1240px; margin: 0 auto; display: grid; gap: 18px; }
.form-section { background: rgba(255, 255, 255, .96); border: 1px solid rgba(217, 225, 232, .9); border-radius: 8px; padding: 22px; box-shadow: var(--shadow); }
.form-section-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.form-section-head span { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 800; }
.form-section-head h2 { margin: 0; font-size: 1.15rem; }
.form-layout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-alert { border: 1px solid #f5c2c0; background: #fff5f5; color: var(--danger); border-radius: 8px; padding: 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.rich-editor .ck-editor, .rich-editor .django-ckeditor-widget { width: 100% !important; max-width: 100%; }
.rich-editor .ck-editor__editable { min-height: 260px; max-height: 520px; }
.rich-editor textarea { min-height: 260px; }
.amenities-field > div, .amenity-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.amenities-field ul { list-style: none; margin: 0; padding: 0; display: contents; }
.amenities-field li { margin: 0; }
.amenities-field label { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 10px; border: 1px solid rgba(217, 225, 232, .9); border-radius: 6px; background: white; font-weight: 700; }
.amenities-field input[type="checkbox"], .form-switches input[type="checkbox"], .form-check-input { width: 18px; height: 18px; min-height: auto; accent-color: var(--green); flex: 0 0 auto; }
.form-switches { display: flex; gap: 12px; flex-wrap: wrap; }
.form-switches label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--gold-soft); font-weight: 800; }
input[type="file"] { padding: 8px; background: #fff; }
.form-actions { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 16px 0 0; background: linear-gradient(180deg, rgba(247, 250, 249, 0), #eef5f2 42%); }
.form-actions button, .form-actions .btn { min-width: 170px; }

.detail-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); gap: 28px; align-items: center; }
.detail-hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); }
.detail-hero > div { min-width: 0; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 28px; margin-top: 34px; align-items: start; }
.detail-grid > section, .inquiry-box { min-width: 0; }
.stats, .chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.stats span, .chips span { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: white; }
.rich-text { overflow-wrap: anywhere; }
.rich-text img { height: auto !important; max-width: 100%; }

.dashboard { max-width: 1240px; margin: 0 auto; }
.table-wrap { overflow-x: auto; margin: 22px 0; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 26px rgba(23, 32, 42, .05); }
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--green-soft); color: var(--green); font-size: .86rem; text-transform: uppercase; }
td a { color: var(--green); font-weight: 800; }

.messages { padding: 14px 5vw; }
.message { padding: 10px 12px; border-radius: 6px; background: var(--green-soft); border: 1px solid rgba(17, 97, 73, .18); }
.empty { color: var(--muted); }
.site-footer { padding: 28px 5vw; border-top: 1px solid var(--line); color: var(--muted); background: white; }

@media (max-width: 980px) {
  .hero, .detail-hero, .detail-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 50px; }
  .filters, .profile-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-form p:has(textarea), .profile-form button { grid-column: span 2; }
  .form-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-4 { grid-column: span 2; }
}

@media (max-width: 760px) {
  .site-header { display: block; padding: 12px 18px; }
  .header-inner { width: 100%; }
  .menu-toggle { display: inline-block; }
  .site-nav {
    display: none;
    width: 100%;
    padding-top: 12px;
    align-items: stretch;
    justify-content: flex-start;
  }
  .site-header.nav-open .site-nav { display: grid; grid-template-columns: 1fr; }
  .site-nav a, .site-nav button, .site-nav form { width: 100%; }
  .site-nav a, .site-nav button { justify-content: flex-start; }
  .section, .listing-page, .dashboard, .content-page, .auth-shell, .property-detail { padding: 36px 18px; }
  .section-head, .form-hero { align-items: flex-start; flex-direction: column; }
  .property-form-page { padding: 28px 18px 48px; }
  .form-section { padding: 18px; }
  .form-card-grid, .filters, .profile-form { grid-template-columns: 1fr; }
  .form-card-grid p:last-of-type, .form-card-grid button, .profile-form p:has(textarea), .profile-form button { grid-column: auto; }
  .profile-head { align-items: flex-start; flex-direction: column; padding: 36px 18px; }
}

@media (max-width: 560px) {
  .hero { padding-left: 18px; padding-right: 18px; }
  .hero h1 { font-size: 2.55rem; }
  .hero-actions, .detail-actions, .form-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn, .detail-actions .btn, .form-actions button, .form-actions .btn { width: 100%; }
  .property-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: auto; }
  .amenities-field > div, .amenity-checks { grid-template-columns: 1fr; }
  .form-switches { display: grid; grid-template-columns: 1fr; }
  .form-actions { position: static; background: transparent; }
  .auth-card { padding: 20px; }
  table { min-width: 620px; }
}
