:root {
  --bg: #eef3f8;
  --panel: rgba(255,255,255,.84);
  --sheet: #ffffff;
  --text: #122033;
  --muted: #637287;
  --grid: #7a7a7a;
  --brand: #0d5cab;
  --brand-soft: rgba(13,92,171,.10);
  --shadow: 0 18px 50px rgba(16,24,40,.10);
  --lot-width: 182px;
  --lot-height: 112px;
  --radius: 18px;
  --available: #bfdecb;
  --sold: #808080;
  --reserved: #013570;
  --promo: #c65b66;
  --not-sale: #f2f2f2;
  --lobby: #d9c6f3;
  --panel-border: rgba(190, 202, 217, .9);
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.85), transparent 28%),
    linear-gradient(180deg, #f4f7fb 0%, #edf2f7 100%);
  color: var(--text);
}
.page {
  padding: 24px;
}
.header {
  margin-bottom: 12px;
}
.header-top {
  margin-bottom: 16px;
}
.header-controls {
  display:flex;
  align-items:stretch;
  justify-content:flex-start;
  gap:18px;
  margin-bottom: 12px;
}
.project-intro {
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.project-main {
  display:flex;
  align-items:flex-start;
  gap:18px;
  min-width: 0;
  flex: 1 1 auto;
}
.project-logo {
  flex: 0 0 150px;
  width: 150px;
  min-width: 150px;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  display:flex;
  align-items:center;
  justify-content:center;
}
.project-logo img {
  width: 100%;
  height: auto;
  display:block;
  object-fit: contain;
}
.project-copy {
  min-width: 0;
  padding-top: 2px;
}
.title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.04;
  margin: 0 0 8px;
}
.subtitle {
  margin:0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.project-meta {
  margin-top: 14px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.project-link {
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(197,211,226,.96);
  background: rgba(255,255,255,.92);
  color: var(--text);
  text-decoration:none;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.project-link:hover {
  border-color: var(--brand);
}
.project-link .meta-label {
  color: var(--muted);
  font-weight: 600;
}
.kpis {
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
  width:328px;
  flex: 0 0 328px;
  align-self: stretch;
}
.project-intro .kpis {
  flex: 0 0 328px;
  width: 343px;
  max-width: 328px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.kpi .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.kpi .value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.toolbar {
  display:grid;
  grid-template-columns: repeat(2, minmax(220px, 280px));
  gap:12px;
  justify-content:start;
  align-items:stretch;
  flex: 1 1 auto;
}
.control {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-height: 58px;
}
.control label {
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.control input,
.control select {
  width:100%;
  border:1px solid #c5d3e2;
  border-radius: 10px;
  font-size:14px;
  padding:10px 12px;
  background:#fff;
  color: var(--text);
  outline:none;
}
.control input:focus,
.control select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,92,171,.12);
}
.layout {
  display:grid;
  grid-template-columns: minmax(0, 1fr) 343px;
  gap: 18px;
  align-items:start;
}
.sidebar {
  position: sticky;
  top: 24px;
  width: 343px;
  min-width: 343px;
  max-width: 328px;
}
.sidebar > * {
  width: 100%;
}

.board-wrap {
  position: relative;
  background: var(--panel);
  border:1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 15px;
  overflow:hidden;
}
.board-toolbar {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 8;
  display:flex;
  align-items:center;
  gap:6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(207,216,227,.9);
  box-shadow: 0 18px 40px rgba(15,23,42,.12);
  backdrop-filter: blur(10px);
}
.board-zoom-btn {
  width: 35px;
  height: 35px;
  border:1px solid rgba(197,211,226,.96);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  cursor:pointer;
  font-size: 18px;
  font-weight: 800;
}
.board-zoom-btn:hover:not(:disabled) {
  border-color: var(--brand);
}
.board-zoom-btn:disabled {
  opacity: .42;
  cursor: default;
  box-shadow: none;
}
.board-viewport {
  overflow:auto;
  border-radius: 18px;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  max-width: 100%;
  height: 802px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.board-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.board-surface {
  position: relative;
  width: max-content;
  height: auto;
}
.board {
  min-width: fit-content;
  transform-origin: top left;
  will-change: transform;
}
.floor {
  display:grid;
  grid-template-columns: 84px max-content;
  align-items:stretch;
}
.floor + .floor {
  margin-top: -1px;
}
.floor-label {
  border:1px solid var(--grid);
  background:#f7f9fb;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  font-weight:800;
  font-size:18px;
  line-height:1.05;
  letter-spacing:.02em;
  min-height: var(--lot-height);
  position:relative;
}
.floor-label small {
  display:block;
  margin-top:4px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color: var(--muted);
}
.floor-label.is-clickable {
  cursor: pointer;
  transition: background-color .18s ease, box-shadow .18s ease, filter .18s ease;
}
.floor-label.is-clickable:hover {
  filter: brightness(1.02);
  box-shadow: inset 0 0 0 2px rgba(13,92,171,.28);
}
.floor-label.is-clickable:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(13,92,171,.78);
}
.floor-grid {
  display:grid;
  grid-template-columns: repeat(var(--cols), var(--lot-width));
  grid-auto-rows: var(--lot-height);
}
.floor-grid > * {
  margin-left: -1px;
}
.floor-grid > *:first-child {
  margin-left: 0;
}
.floor.floor-lobby .floor-label {
  background: var(--lobby);
  color: #594975;
}
.floor.floor-lobby .floor-label small {
  color: #6d5b8f;
}
.lobby-merged {
  grid-column: 1 / -1;
  min-height: var(--lot-height);
  border: 1px solid var(--grid);
  background: var(--lobby);
  appearance:none;
  -webkit-appearance:none;
  display:block;
  width:100%;
  cursor:pointer;
  transition: background-color .18s ease, box-shadow .18s ease, filter .18s ease;
}
.lobby-merged.is-hover {
  filter: brightness(1.03);
  box-shadow: inset 0 0 0 2px rgba(13,92,171,.78);
  z-index:2;
}
.lobby-merged.is-selected {
  filter: brightness(.99);
  box-shadow: inset 0 0 0 2px rgba(13,92,171,.95);
  z-index:3;
}
.lobby-merged:focus-visible {
  outline:none;
  box-shadow: inset 0 0 0 2px var(--brand);
}
.lot,
.lot-empty {
  position:relative;
  width: var(--lot-width);
  height: var(--lot-height);
  border:1px solid var(--grid);
  background: #fff;
  padding: 11px 10px 10px;
}
.lot-empty {
  background:#fafafa;
}
.lot {
  appearance:none;
  -webkit-appearance:none;
  display:grid;
  grid-template-rows:auto 1fr auto;
  gap:8px;
  text-align:left;
  cursor:pointer;
  transition: background-color .18s ease, box-shadow .18s ease, filter .18s ease, transform .12s ease, opacity .18s ease;
}
.lot:focus-visible {
  outline:none;
  box-shadow: inset 0 0 0 2px var(--brand);
}
.lot-top,
.lot-bottom {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
}
.lot-top {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
}
.lot-top .room-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.lot-number {
  display:inline-block;
}
.lot-price {
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}
.lot-bottom {
  font-size: 12px;
  line-height: 1.05;
}
.lot-bottom .sqm-price {
  text-align:right;
}
.lot[data-status="available"] { background: var(--available); }
.lot[data-status="sold"] { background: var(--sold); color: var(--sold); }
.lot[data-status="reserved"] { background: var(--reserved); color: var(--reserved); }
.lot[data-status="reserved"].is-locked .lot-number { color: #ffffff; }
.lot[data-status="promo"] { background: var(--promo); color:#fff; }
.lot[data-status="not_sale"] { background: var(--not-sale); color: var(--not-sale); }
.lot[data-status="sold"].is-locked .lot-number { color: #ffffff; }
.lot[data-status="not_sale"].is-locked .lot-number { color: var(--text); }
.lot.is-locked,
.lot:disabled {
  cursor: default;
  pointer-events: none;
}
.lot.is-locked:focus-visible,
.lot:disabled:focus-visible {
  box-shadow: none;
}
.lot.is-dim {
  opacity: .16;
  filter: grayscale(.38);
  pointer-events:none;
}
.lot.is-hover {
  filter: brightness(1.03);
  box-shadow: inset 0 0 0 2px rgba(13,92,171,.78);
  z-index:2;
}
.lot.is-selected {
  filter: brightness(.99);
  box-shadow: inset 0 0 0 2px rgba(13,92,171,.95);
  z-index:3;
}

.sidebar-card,
.empty-state {
  background: var(--panel);
  border:1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.empty-state {
  color: var(--muted);
  font-size: 14px;
}
.badge {
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:800;
  background:#eef3f8;
}
.badge .dot {
  width:10px;
  height:10px;
  border-radius:50%;
}
.badge.available .dot { background:#fff; border:1px solid #94a3b8; }
.badge.sold .dot { background:#808080; }
.badge.reserved .dot { background:#013570; }
.badge.promo .dot { background: var(--promo); }
.badge.not_sale .dot { background:#f2f2f2; border:1px solid #c7d0db; }
.panel-head {
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  margin-bottom:14px;
}
.panel-number {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}
.panel-subtitle {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14px;
}
.info-grid {
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-bottom: 14px;
}
.info-item {
  background: rgba(255,255,255,.85);
  border:1px solid rgba(207,216,227,.9);
  border-radius: 14px;
  padding: 10px 12px;
}
.info-item .title {
  margin:0 0 6px;
  font-size:12px;
  color: var(--muted);
}
.info-item .value {
  font-size:16px;
  font-weight:800;
  line-height:1.15;
}
.plan-card {
  background: rgba(255,255,255,.85);
  border:1px solid rgba(207,216,227,.9);
  border-radius: 18px;
  padding: 12px;
}
.plan-tabs {
  display:flex;
  gap:8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.plan-tab {
  appearance:none;
  -webkit-appearance:none;
  border:none;
  border-radius: 12px;
  background: rgba(13,92,171,.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 11px 14px;
  cursor:pointer;
}
.plan-tab.is-active {
  background: rgba(13,92,171,.14);
  color: var(--brand);
}
.plan-pane {
  display:none;
}
.plan-pane.is-active {
  display:block;
}
.plan-card .plan-title {
  margin:0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.plan-card img {
  width:100%;
  height:auto;
  display:block;
  border-radius: 12px;
  background:#e5e7eb;
  cursor: zoom-in;
}
.visual-card {
  margin-top: 14px;
  background: rgba(255,255,255,.85);
  border:1px solid rgba(207,216,227,.9);
  border-radius: 18px;
  padding: 12px;
}
.visual-card .plan-title {
  margin:0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.visual-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background:#e5e7eb;
}
.visual-stage img {
  width:100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display:block;
  cursor: zoom-in;
  background:#e5e7eb;
}
.visual-nav {
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width: 36px;
  height: 36px;
  border:none;
  background: transparent;
  color: #ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.visual-nav:hover {
  opacity: .9;
}
.visual-nav.prev { left: 10px; }
.visual-nav.next { right: 10px; }
.visual-counter {
  position:absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15,23,42,.10);
  z-index: 2;
}
.visual-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  background: rgba(0,0,0,.96);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overscroll-behavior: contain;
}

.visual-lightbox.is-open {
  display: flex;
}

.visual-lightbox-dialog {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #000;
  box-shadow: none;
  overflow: hidden;
}

.visual-lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-lightbox-stage img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0;
  background: #000;
  user-select: none;
  -webkit-user-drag: none;
}

.visual-lightbox .visual-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 72px;
  border: none;
  border-radius: 14px;
  background: rgba(0,0,0,.34);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,.65);
  z-index: 10001;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.visual-lightbox .visual-nav:hover {
  background: rgba(0,0,0,.58);
  opacity: 1;
}

.visual-lightbox .visual-nav.prev {
  left: max(18px, env(safe-area-inset-left));
}

.visual-lightbox .visual-nav.next {
  right: max(18px, env(safe-area-inset-right));
}

.visual-lightbox .visual-counter {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  z-index: 10001;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.visual-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(0,0,0,.58);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.visual-close:hover {
  background: rgba(0,0,0,.82);
}

@media (max-width: 920px) {
  .visual-lightbox .visual-nav {
    width: 44px;
    height: 60px;
    border-radius: 12px;
    font-size: 34px;
  }

  .visual-lightbox .visual-nav.prev {
    left: max(8px, env(safe-area-inset-left));
  }

  .visual-lightbox .visual-nav.next {
    right: max(8px, env(safe-area-inset-right));
  }

  .visual-close {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .visual-lightbox .visual-counter {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

.legend {
  margin-top: 12px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color: var(--muted);
  font-size:12px;
}
.legend-item {
  display:inline-flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,.7);
  border:1px solid rgba(207,216,227,.9);
  border-radius:999px;
  padding: 7px 10px;
}
.legend-item .swatch {
  width:12px;
  height:12px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,.08);
}
.legend-item.available .swatch { background: var(--available); }
.legend-item.sold .swatch { background: var(--sold); }
.legend-item.reserved .swatch { background: var(--reserved); }
.legend-item.promo .swatch { background: var(--promo); }
.legend-item.not_sale .swatch { background: var(--not-sale); }
.legend-item.lobby .swatch { background: var(--lobby); }
@media (max-width: 1200px) {
  .project-intro {
    flex-direction: column;
    align-items: stretch;
  }
  .project-intro .kpis {
    width: 100%;
    max-width: 328px;
    flex: 1 1 auto;
  }
  .header-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar {
    grid-template-columns: repeat(2, minmax(220px, 280px));
  }
  .kpis {
    width: 100%;
    flex: 1 1 auto;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}
@media (max-width: 920px) {
  .page {
    padding: 16px;
  }
  .project-intro {
    flex-direction: column;
    align-items: stretch;
  }
  .project-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .project-logo {
    width: 110px;
    min-width: 110px;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
  }
  .title {
    font-size: 28px;
  }
  .project-intro .kpis,
  .kpis {
    grid-template-columns: repeat(2, minmax(0,1fr));
    width: 100%;
    max-width: 328px;
    flex: 1 1 auto;
  }
  .toolbar {
    grid-template-columns: 1fr;
  }
  .board-toolbar {
    top: 22px;
    right: 22px;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
  .board-viewport {
    height: 68vh;
    min-height: 420px;
  }
}
/* Performance/UI tweaks for externalized assets */
.plan-pane img[data-plan-src]:not([src]) {
  visibility: hidden;
}
.visual-stage img,
.plan-card img,
.visual-lightbox-stage img {
  image-rendering: auto;
}