:root {
  --ink: #1f2d27;
  --muted: #6e7772;
  --cream: #f7f4ec;
  --paper: #fffdf8;
  --green: #365e4a;
  --green-dark: #234537;
  --available: #8eae79;
  --reserved: #f0c84b;
  --sold: #d84a3a;
  --line: rgba(31, 45, 39, 0.14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
  min-height: 88px;
  padding: 0 clamp(24px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: rgba(247, 244, 236, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--green); color: #fff; border-radius: 50%;
}
.brand-mark svg { width: 25px; fill: currentColor; }
.brand b { display: block; font-family: "Prata", serif; font-size: 16px; font-weight: 400; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
nav { display: flex; gap: clamp(20px, 3vw, 44px); font-size: 13px; font-weight: 600; }
nav a { transition: color .2s; }
nav a:hover { color: var(--green); }
.nav-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s;
}
.nav-button:hover { color: var(--green); }
.header-phone { text-align: right; font-size: 14px; font-weight: 700; }
.header-phone small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; margin-bottom: 3px; }

main { overflow: hidden; }
.hero {
  max-width: 1440px;
  padding: clamp(64px, 8vw, 118px) clamp(24px, 8vw, 120px) clamp(58px, 7vw, 96px);
  margin: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: "Prata", serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(42px, 5.7vw, 80px); line-height: 1.07; letter-spacing: -.025em; }
.hero-copy { max-width: 390px; margin: 0 0 8px; color: var(--muted); font-size: 15px; line-height: 1.8; }

.map-section {
  padding: clamp(42px, 5vw, 72px) clamp(18px, 5vw, 72px) clamp(60px, 8vw, 120px);
  background: var(--green-dark);
  color: #fff;
}
.map-toolbar {
  max-width: 1320px; margin: 0 auto 28px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
}
.map-toolbar .eyebrow { color: #b7c8bc; margin-bottom: 10px; }
.map-toolbar h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); }
.legend { display: flex; flex-wrap: wrap; gap: 24px; color: #d7dfda; font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; }
.legend .sale-fill {
  background: #c1c8b9;
  border: 1px solid rgba(45, 70, 52, .25);
}
.legend .reserved-fill { background: var(--reserved); }
.legend .sold-fill { background: var(--sold); }
.legend .boundary {
  width: 24px;
  height: 0;
  border-top: 3px dashed #7689d0;
  border-radius: 0;
}
.map-layout {
  max-width: 1320px; min-height: 620px; margin: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 310px;
  background: var(--paper); box-shadow: 0 28px 70px rgba(0,0,0,.25);
}
.map-shell { position: relative; min-width: 0; overflow: hidden; background: #f3f3f1; }
.plan-viewport {
  width: 100%;
  height: 720px;
  overflow: auto;
  scrollbar-color: rgba(54, 94, 74, .45) transparent;
}
.plan-canvas {
  position: relative;
  width: 100%;
  min-width: 650px;
  transition: width .25s ease;
}
.plan-canvas img { display: block; width: 100%; height: auto; user-select: none; }
.sale-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.sale-zone {
  outline: none;
}
.sale-plot {
  cursor: pointer;
  outline: none;
}
.sale-hit {
  fill: rgba(80, 126, 56, 0);
  stroke: transparent;
  pointer-events: all;
  transition: fill .2s, stroke .2s, filter .2s;
}
.sale-plot.status-reserved .sale-hit {
  fill: rgba(240, 200, 75, .72);
  stroke: rgba(142, 104, 18, .72);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.sale-plot.status-sold .sale-hit {
  fill: rgba(216, 74, 58, .76);
  stroke: rgba(126, 36, 29, .76);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.sale-plot:hover .sale-hit,
.sale-plot:focus .sale-hit,
.sale-plot.active .sale-hit {
  fill: rgba(80, 126, 56, .30);
  stroke: rgba(36, 76, 55, .65);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 3px 5px rgba(31, 45, 39, .22));
}
.sale-plot.status-reserved:hover .sale-hit,
.sale-plot.status-reserved:focus .sale-hit,
.sale-plot.status-reserved.active .sale-hit {
  fill: rgba(240, 200, 75, .72);
  stroke: rgba(142, 104, 18, .72);
  filter: none;
}
.sale-plot.status-sold:hover .sale-hit,
.sale-plot.status-sold:focus .sale-hit,
.sale-plot.status-sold.active .sale-hit {
  fill: rgba(216, 74, 58, .76);
  stroke: rgba(126, 36, 29, .76);
  filter: none;
}
.map-zoom {
  position: absolute;
  z-index: 6;
  right: 18px;
  top: 18px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255,255,255,.94);
  border-radius: 6px;
  box-shadow: 0 3px 15px rgba(0,0,0,.09);
}
.map-zoom button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 20px;
  cursor: pointer;
}
.map-zoom button:hover { background: #edf1eb; }
.map-zoom span { min-width: 48px; font-size: 9px; font-weight: 700; text-align: center; }
.map-hint {
  position: absolute; z-index: 4; top: 18px; left: 18px;
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  color: var(--ink); background: rgba(255,255,255,.9); border-radius: 6px;
  font-size: 10px; font-weight: 600; box-shadow: 0 3px 15px rgba(0,0,0,.09);
  pointer-events: none;
}
.mouse-icon { width: 11px; height: 16px; border: 1.5px solid var(--green); border-radius: 7px; position: relative; }
.mouse-icon::after { content: ""; position: absolute; top: 3px; left: 4px; width: 1.5px; height: 4px; background: var(--green); }
.water { fill: #a6c6cb; }
.water-line { fill: none; stroke: #fff; stroke-width: 3; opacity: .55; }
.forest-patch { fill: #b8c7ae; opacity: .65; }
.trees { fill: #78936e; opacity: .8; }
.road { fill: none; stroke: #e7dfd0; stroke-width: 66; }
.road-edge { fill: none; stroke: #c2b9aa; stroke-width: 1.5; stroke-dasharray: 9 7; }
.map-label { fill: #617169; font: 600 11px "Manrope", sans-serif; letter-spacing: .24em; }
.water-label { fill: #617e83; }
.road-label { fill: #9a8e7d; font-size: 9px; }
.forest-label { fill: #6d8067; font-size: 9px; }
.facility rect { fill: #f0ede3; stroke: #a7a99d; stroke-width: 1.5; }
.facility path { fill: none; stroke: #78867d; stroke-width: 2; }
.facility text { text-anchor: middle; fill: #65736b; font: 600 9px "Manrope"; letter-spacing: .13em; }
.compass circle { fill: rgba(255,255,255,.68); stroke: #92a095; }
.compass path { fill: #486453; }
.compass text { text-anchor: middle; fill: #486453; font: 700 11px "Manrope"; }

.plot { cursor: pointer; outline: none; }
.plot polygon {
  stroke: rgba(48, 70, 58, .7); stroke-width: 1.5;
  transition: fill .18s, opacity .18s, filter .18s, stroke-width .18s;
}
.plot text {
  text-anchor: middle; dominant-baseline: central;
  fill: #425448; font: 700 13px "Manrope"; pointer-events: none;
}
.plot.available polygon { fill: #b7caa7; }
.plot.reserved polygon { fill: #e0c17e; }
.plot.sold polygon { fill: #c7cbc5; opacity: .75; }
.plot:hover polygon, .plot:focus polygon, .plot.active polygon {
  fill: #fff8dc; opacity: 1; stroke: #254a39; stroke-width: 3; filter: url(#shadow);
}
.plot:hover text, .plot:focus text, .plot.active text { fill: #1f3e30; }

.plot-card {
  color: var(--ink); background: var(--paper); border-left: 1px solid var(--line);
  min-height: 100%; padding: 34px 30px; position: relative;
}
.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.empty-icon svg { width: 27px; fill: none; stroke: var(--green); stroke-width: 1.2; }
.empty-state h3 { margin: 22px 0 8px; font-size: 22px; }
.empty-state p { max-width: 200px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.plot-details { animation: card-in .28s ease both; }
@keyframes card-in { from { opacity: 0; transform: translateY(7px); } }
.card-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 46px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 99px; background: #e8efe4; color: #45613e; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.available { background: #e8efe4; color: #45613e; }
.status-pill.reserved { background: #fff4bf; color: #8e6812; }
.status-pill.sold { background: #ffe0dc; color: #9d2d22; }
.close-card { border: 0; background: none; color: #89908c; font-size: 24px; line-height: 1; cursor: pointer; }
.plot-kicker { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; }
.plot-details h3 { margin: 6px 0 30px; font-size: 28px; }
dl { margin: 0; border-top: 1px solid var(--line); }
dl div { padding: 15px 0; display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 0; text-align: right; font-size: 12px; font-weight: 700; }
.plot-note { min-height: 42px; margin: 20px 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.primary-button {
  width: 100%; border: 0; padding: 14px 18px; color: #fff; background: var(--green);
  font-size: 11px; font-weight: 700; cursor: pointer; transition: background .2s, transform .2s;
}
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.plot-details > small { display: block; margin-top: 10px; color: #929894; font-size: 8px; text-align: center; }

.contact-strip { padding: 80px 24px; text-align: center; background: #f2eee4; }
.contact-strip h2 { margin: 0 0 22px; font-size: clamp(32px, 4vw, 52px); }
.contact-strip a { color: var(--green); font-size: 19px; font-weight: 700; }
footer { padding: 25px clamp(24px, 5vw, 76px); display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,34,27,.72); backdrop-filter: blur(5px); }
.modal-dialog { position: relative; width: min(430px, 100%); padding: 42px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.modal-dialog h2 { font-size: 34px; margin: 0 0 12px; }
.modal-dialog > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.7; margin-bottom: 26px; }
.modal-dialog label { display: block; margin: 16px 0; color: var(--muted); font-size: 10px; }
.modal-dialog input { width: 100%; display: block; margin-top: 7px; padding: 13px 12px; border: 1px solid var(--line); background: #fff; outline: none; }
.modal-dialog input:focus { border-color: var(--green); }
.modal-close { position: absolute; top: 15px; right: 18px; border: 0; background: none; color: var(--muted); font-size: 25px; cursor: pointer; }
body.modal-open { overflow: hidden; }

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 15%, rgba(142, 174, 121, .28), transparent 34%),
    linear-gradient(135deg, #f7f4ec 0%, #e9efe4 100%);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-card {
  width: min(440px, 100%);
  padding: clamp(30px, 6vw, 48px);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(31, 45, 39, .16);
}
.login-brand { margin-bottom: 42px; }
.login-card h1 {
  margin: 0;
  font-size: clamp(34px, 8vw, 52px);
  line-height: 1.05;
}
.login-copy {
  margin: 14px 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.login-form label {
  display: block;
  margin: 16px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-form input {
  width: 100%;
  display: block;
  margin-top: 8px;
  padding: 14px 12px;
  border: 1px solid rgba(31, 45, 39, .16);
  background: #fff;
  color: var(--ink);
  outline: none;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.login-form input:focus { border-color: var(--green); }
.login-error {
  margin: 0 0 16px;
  color: #9d2d22;
  font-size: 12px;
  font-weight: 700;
}

.admin-page { background: #f7f4ec; }
.admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 70px) clamp(18px, 4vw, 46px) 80px;
}
.admin-hero {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) minmax(260px, 420px);
  gap: 34px;
  align-items: end;
  margin-bottom: 34px;
}
.admin-hero .eyebrow { margin-bottom: 8px; }
.admin-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
}
.admin-hero p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.admin-panel {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(31, 45, 39, .12);
}
.admin-toolbar {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.admin-toolbar h2 {
  margin: 0 0 6px;
  font-size: 28px;
}
.admin-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--green);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.secondary-button:hover { background: #f1f4ef; }
.file-button input { display: none; }
.admin-table-wrap { overflow: auto; }
.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}
.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fbfaf5;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.admin-table strong { font-size: 12px; }
.admin-table input,
.admin-table select {
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid rgba(31, 45, 39, .16);
  background: #fff;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  font-size: 12px;
}
.admin-table input:focus,
.admin-table select:focus { border-color: var(--green); }
.table-clear {
  border: 0;
  background: transparent;
  color: #9a7464;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.table-clear:hover { color: #6f4637; }
.admin-table tr.is-saved td {
  background: #f0f5ec;
  transition: background .25s;
}

@media (max-width: 900px) {
  .site-header nav { display: none; }
  .hero { align-items: flex-start; flex-direction: column; gap: 28px; }
  .map-layout { grid-template-columns: 1fr; }
  .map-shell { min-height: 510px; }
  .plan-viewport { height: 590px; }
  .plot-card { min-height: 360px; border-left: 0; border-top: 1px solid var(--line); }
  .empty-state { min-height: 290px; }
  .admin-hero { grid-template-columns: 1fr; align-items: start; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .site-header { min-height: 72px; }
  .brand b { font-size: 13px; }
  .brand-mark { width: 36px; height: 36px; }
  .header-phone small { display: none; }
  .header-phone { font-size: 0; }
  .header-phone::after { content: "Позвонить"; font-size: 11px; color: var(--green); }
  .hero { padding-top: 52px; }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  .legend { gap: 13px; }
  .map-section { padding-left: 12px; padding-right: 12px; }
  .plan-viewport { height: 520px; }
  .plan-canvas { min-width: 560px; }
  .plot-card { padding: 28px 24px; }
  footer { gap: 20px; flex-direction: column; }
}
