:root {
  --navy: #0c1b2a;
  --navy-2: #13283d;
  --navy-3: #1b3a58;
  --gold: #c4a35a;
  --gold-2: #d4b56d;
  --ink: #1a2332;
  --muted: #667085;
  --paper: #f4f1eb;
  --line: #e6e1d8;
  --white: #fff;
  --green: #1f7a4d;
  --rose: #b42318;
  --shadow: 0 18px 50px rgba(12, 27, 42, .08);
  --sidebar: 272px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, .brand, .hero-copy h1, .login-panel h1 {
  font-family: Fraunces, Georgia, serif;
}

a { color: var(--navy-3); text-decoration: none; }
a:hover { color: var(--gold); }

.btn-gold {
  background: var(--gold);
  border: 0;
  color: var(--navy);
  font-weight: 700;
  border-radius: 12px;
  padding: .7rem 1.15rem;
}
.btn-gold:hover { background: var(--gold-2); color: var(--navy); }
.btn-outline-navy {
  border: 1px solid var(--navy);
  color: var(--navy);
  font-weight: 600;
  border-radius: 12px;
}
.btn-outline-navy:hover { background: var(--navy); color: #fff; }
.btn-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
}
.form-control, .form-select {
  border-radius: 12px;
  border-color: #d9d3c8;
  padding: .7rem .9rem;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 .2rem rgba(196, 163, 90, .2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-weight: 650;
  color: var(--navy);
  font-size: 1.15rem;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Landing */
.public-body { background: var(--navy); }
.landing { min-height: 100vh; color: #e9e4d8; }
.landing-nav, .landing-hero, .landing-features, .landing-foot {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
}
.landing-nav .brand { color: #fff; }
.landing-hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0 3.5rem;
}
.eyebrow {
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 700;
}
.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.12;
  color: #fff;
  margin-bottom: 1rem;
}
.lead-text { color: #c9c3b6; font-size: 1.05rem; }
.hero-points { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.hero-points li { display: flex; gap: .6rem; margin-bottom: .5rem; }
.hero-points i { color: var(--gold); }
.hero-card, .login-panel {
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.hero-card h2, .login-panel h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.landing-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-bottom: 3rem;
}
.landing-features article {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 1.2rem;
}
.landing-features i { color: var(--gold); font-size: 1.4rem; }
.landing-features h3 { color: #fff; font-size: 1.05rem; margin: .7rem 0 .35rem; font-family: "Plus Jakarta Sans", sans-serif; }
.landing-features p { color: #b9b3a6; margin: 0; font-size: .92rem; }
.landing-foot {
  display: flex;
  justify-content: space-between;
  padding: 1.2rem 0 2rem;
  color: #9a9488;
  border-top: 1px solid rgba(255,255,255,.08);
}
.landing-foot a { color: var(--gold); }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(196,163,90,.18), transparent 28%),
    var(--navy);
}
.login-panel { width: min(440px, 100%); }

/* Admin */
.admin-body { background: #efece6; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar, .admin-offcanvas {
  width: var(--sidebar);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #d7d1c6;
  flex-direction: column;
  padding: 1.2rem .9rem;
}
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; }
.sidebar-brand {
  display: flex;
  gap: .75rem;
  align-items: center;
  color: #fff;
  padding: .4rem .55rem 1.2rem;
}
.sidebar-brand small { display: block; color: #b7b1a5; font-size: .75rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #d7d1c6;
  padding: .7rem .8rem;
  border-radius: 12px;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(196,163,90,.14);
  color: #fff;
}
.sidebar-link.active { box-shadow: inset 3px 0 0 var(--gold); }
.sidebar-logout { margin-top: auto; color: #f0b4ae; }
.admin-offcanvas { background: var(--navy); }
.admin-main { flex: 1; min-width: 0; }
.admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-titles { flex: 1; min-width: 0; }
.header-titles h1 { font-size: 1.45rem; margin: 0; }
.header-titles p { margin: 0; color: var(--muted); font-size: .9rem; }
.header-actions { display: flex; gap: .6rem; align-items: center; }
.profile-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .7rem .25rem .25rem;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.profile-meta { text-align: left; line-height: 1.15; }
.profile-meta strong { display: block; font-size: .85rem; }
.profile-meta small { color: var(--muted); }
.notify-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--rose);
  color: #fff;
  font-size: .65rem;
  border-radius: 999px;
  padding: 0 .28rem;
}
.notify-menu { width: 300px; padding: .4rem 0; }
.notify-head, .notify-empty { padding: .7rem 1rem; color: var(--muted); }
.notify-item { display: flex; flex-direction: column; gap: .15rem; white-space: normal; }
.admin-content { padding: 1.25rem 1.4rem 2rem; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kpi-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: .9rem;
  align-items: center;
  box-shadow: var(--shadow);
}
.kpi-card span { display: block; color: var(--muted); font-size: .82rem; }
.kpi-card strong { font-size: 1.45rem; }
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f3eee4;
  color: var(--navy);
  font-size: 1.2rem;
}
.tone-green .kpi-icon { background: #e7f4ec; color: var(--green); }
.tone-gold .kpi-icon { background: #f8efd8; color: #8a6a1f; }
.tone-rose .kpi-icon { background: #fde8e6; color: var(--rose); }

.panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.panel-head h2 { font-size: 1.15rem; margin: 0; }
.panel-head span, .panel-head a { color: var(--muted); font-size: .88rem; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2rem; color: var(--gold); }
.empty-state.compact { padding: 1rem 0; }
.stat-list, .activity-list { list-style: none; padding: 0; margin: 0; }
.stat-list li, .activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.activity-list li { flex-direction: column; align-items: flex-start; }
.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .75rem;
  font-weight: 700;
  background: #eef2f6;
}
.status-published { background: #e7f4ec; color: var(--green); }
.status-draft { background: #f8efd8; color: #8a6a1f; }
.status-sold_out { background: #fde8e6; color: var(--rose); }

.coming-soon { text-align: center; padding: 3.2rem 1.5rem; }
.coming-soon i { font-size: 2.2rem; color: var(--gold); }
.phase-chip {
  display: inline-block;
  background: #f8efd8;
  color: #8a6a1f;
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.alert { border: 0; border-radius: 14px; }
.status-archived { background: #eef2f6; color: #475569; }

.filter-bar { display: flex; gap: .6rem; flex-wrap: wrap; flex: 1; }
.filter-bar .form-control { max-width: 280px; }
.filter-bar .form-select { max-width: 180px; }
.table-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; background: #eee; }
.property-table td { vertical-align: middle; }
.property-card {
  display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.property-card img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; }
.property-card h3 { font-size: 1.05rem; margin: .35rem 0 .15rem; font-family: "Plus Jakarta Sans", sans-serif; }
.property-card p { margin: 0; color: var(--muted); font-size: .88rem; }

.form-tabs-wrap { overflow-x: auto; }
.form-tabs { flex-wrap: nowrap; gap: .35rem; }
.form-tabs .nav-link {
  white-space: nowrap; color: var(--navy); border-radius: 999px; font-weight: 600;
}
.form-tabs .nav-link.active { background: var(--navy); color: #fff; }
.form-hint { color: var(--muted); font-size: .82rem; margin-top: .3rem; }
.form-sticky-actions {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: .8rem;
  padding: 1rem 0 0; background: linear-gradient(transparent, #efece6 30%);
}
.tag-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-pill { cursor: pointer; }
.tag-pill input { display: none; }
.tag-pill span {
  display: inline-block; border: 1px solid var(--tag, var(--line)); border-radius: 999px;
  padding: .25rem .7rem; background: #fff; font-size: .85rem;
}
.tag-pill input:checked + span {
  background: var(--tag, var(--navy)); color: #fff; border-color: var(--tag, var(--navy));
}
.tag-chip {
  display: inline-flex; align-items: center;
  background: #fff; color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--tag, var(--gold));
  border-radius: 999px; padding: .12rem .55rem .12rem .65rem;
  font-size: .75rem; font-weight: 650; white-space: nowrap;
}
.tag-chip-wrap { display: flex; flex-wrap: wrap; gap: .25rem; max-width: 220px; }
.lead-rule-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .35rem; font-family: "Plus Jakarta Sans", sans-serif; }
.lead-kpis { grid-template-columns: repeat(4, 1fr); }
.lead-form select[multiple] { min-height: 140px; }
.form-control-color { width: 3rem; height: 2.5rem; padding: .15rem; }

.filter-panel { padding-bottom: .2rem; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}
.filter-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.media-card {
  position: relative; border-radius: 14px; overflow: hidden; background: #eee; cursor: grab;
}
.media-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.media-flags { position: absolute; top: 8px; left: 8px; display: flex; gap: .3rem; }
.media-flags span, .flag-cover, .flag-profile {
  display: none; background: var(--navy); color: #fff; font-size: .68rem;
  font-weight: 700; border-radius: 999px; padding: .1rem .4rem;
}
.is-cover .flag-cover, .is-profile .flag-profile { display: inline; }
.media-actions {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: .25rem;
  padding: .4rem; background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.media-actions .btn { font-size: .72rem; }

.property-map { height: 360px; border-radius: 16px; background: #d9d3c8; }
.map-toolbar .btn.active { background: var(--navy); color: #fff; }
.inventory-map { height: calc(100vh - 260px); min-height: 420px; border-radius: 16px; background: #d9d3c8; }
.map-info { max-width: 220px; }
.map-info img { width: 100%; height: 88px; object-fit: cover; border-radius: 8px; margin-bottom: .4rem; display: block; }
.map-info strong { display: block; font-size: .95rem; }
.map-info span, .map-info a { display: block; font-size: .8rem; color: var(--muted); }
.map-info a { color: var(--navy); font-weight: 600; margin-top: .35rem; }
.map-info .map-status {
  display: inline-flex; width: auto; margin-bottom: .35rem;
}
.map-info .map-window { color: #8a6a1f; }
.sold-out-meta {
  display: flex; flex-direction: column; gap: .1rem;
  margin-top: .35rem; color: var(--muted); font-size: .75rem; font-weight: 500;
}

.location-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.location-col { display: flex; flex-direction: column; min-height: 520px; }
.location-list { flex: 1; overflow-y: auto; max-height: 58vh; display: flex; flex-direction: column; gap: .5rem; }
.location-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .75rem .85rem;
  background: #fff;
}
.location-item.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.location-item.is-active a, .location-item.is-active small { color: #fff; }
.location-item-name {
  display: block;
  font-weight: 650;
  color: var(--navy);
}
.location-item small { color: var(--muted); }
.location-item-actions { display: flex; gap: .4rem; margin-top: .55rem; flex-wrap: wrap; }
.location-item.is-active .btn-outline-navy { border-color: #fff; color: #fff; }
.location-item.is-active .btn-outline-navy:hover { background: #fff; color: var(--navy); }
.location-edit { margin-top: .7rem; }
.location-add { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.property-view-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.view-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; }
.view-thumbs { display: flex; gap: .5rem; overflow-x: auto; margin-top: .6rem; }
.view-thumbs img { width: 88px; height: 64px; object-fit: cover; border-radius: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; margin: 0; }
.detail-grid dt { color: var(--muted); font-size: .8rem; }
.detail-grid dd { margin: 0; font-weight: 600; }
.admin-pager { display: flex; justify-content: center; margin-top: 1rem; }
.admin-pager .page-link { color: var(--navy); }
.admin-pager .page-item.active .page-link { background: var(--navy); border-color: var(--navy); }

@media (max-width: 1199px) {
  .kpi-grid, .landing-features { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 1rem; }
  .admin-header { padding: .9rem 1rem; }
  .admin-content { padding: 1rem; }
  .location-board { grid-template-columns: 1fr; }
  .location-col { min-height: 0; }
  .location-list { max-height: 40vh; }
  .inventory-map { height: 70vh; }
}
.interest-heatmap { height: 460px; border-radius: 16px; background: #d9d3c8; }
.chart-wrap { min-height: 180px; }

/* Portal */
.portal-body { background: #efece6; }
.portal-nav {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #d7d1c6;
  position: sticky;
  top: 0;
  z-index: 30;
}
.portal-nav-inner {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 0;
}
.portal-nav .brand { color: #fff; }
.portal-links { gap: .35rem; flex: 1; }
.portal-links a {
  color: #d7d1c6;
  padding: .5rem .85rem;
  border-radius: 999px;
  font-weight: 600;
}
.portal-links a:hover, .portal-links a.active { background: rgba(196,163,90,.16); color: #fff; }
.portal-user { color: #c9c3b6; font-size: .9rem; }
.portal-nav .btn-icon { background: transparent; color: #fff; border-color: rgba(255,255,255,.2); }
.portal-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.25rem auto 2.5rem;
}
.portal-heading { margin-bottom: 1.1rem; }
.portal-heading h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.portal-heading p { margin: .25rem 0 0; color: var(--muted); }
.portal-kpis { margin-bottom: 0; }
.portal-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.portal-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.portal-card-media { position: relative; }
.portal-card-media img { width: 100%; height: 180px; object-fit: cover; display: block; background: #eee; }
.portal-card-badge { position: absolute; top: 10px; left: 10px; }
.portal-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--navy);
  display: grid;
  place-items: center;
}
.portal-fav.is-on, .portal-fav-btn.is-on { color: var(--rose); }
.portal-card-body { padding: .95rem 1rem 1.05rem; display: flex; flex-direction: column; flex: 1; }
.portal-card-meta { margin: 0 0 .2rem; color: var(--muted); font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.portal-card-body h3 { font-size: 1.05rem; margin: 0 0 .35rem; font-family: "Plus Jakarta Sans", sans-serif; }
.portal-card-body h3 a { color: var(--navy); }
.portal-thumb { border: 0; background: none; padding: 0; }
.price-block {
  display: grid;
  gap: .35rem;
  background: #f8f4ec;
  border-radius: 14px;
  padding: .85rem 1rem;
}
.price-block div { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
.price-block span { color: var(--muted); font-size: .82rem; }
.price-block strong { font-size: 1rem; }
.price-block .price-offer strong { color: #8a6a1f; font-size: 1.15rem; }
.price-block.is-compact { padding: .55rem .7rem; margin-top: auto; }
.price-block.is-compact strong { font-size: .92rem; }
.price-block.is-compact .price-offer strong { font-size: 1rem; }

@media (max-width: 991px) {
  .portal-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .portal-card-grid { grid-template-columns: 1fr; }
  .kpi-grid, .landing-features { grid-template-columns: 1fr; }
  .landing-foot { flex-direction: column; gap: .5rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-sticky-actions { flex-direction: column; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .filter-bar .form-control, .filter-bar .form-select { max-width: none; flex: 1; }
  .filter-grid { grid-template-columns: 1fr; }
  .admin-header { padding: .75rem .8rem; gap: .65rem; }
  .header-titles h1 { font-size: 1.1rem; }
  .header-titles p { display: none; }
  .notify-menu { width: min(300px, calc(100vw - 1.5rem)); }
  .interest-heatmap { height: 280px; }
  .inventory-map { height: 58vh; min-height: 260px; }
  .property-map { height: 240px; }
  .panel { padding: .9rem .85rem; }
  .form-tabs-wrap { margin-inline: -.85rem; padding-inline: .85rem; -webkit-overflow-scrolling: touch; }
  .kpi-card strong { font-size: 1.2rem; }
  .portal-nav-inner { gap: .45rem; }
  .form-control, .form-select { font-size: 16px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .property-view-head { flex-direction: column; align-items: stretch; }
}

.is-busy { opacity: .65; pointer-events: none; }
.form-tabs-wrap { scrollbar-width: thin; }
.header-titles h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
