:root {
  --ink: #19202a;
  --muted: #667085;
  --line: #d9e0e7;
  --soft: #f4f7f8;
  --paper: #ffffff;
  --teal: #0f8b8d;
  --green: #18a058;
  --coral: #f06f54;
  --gold: #f7b538;
  --blue: #2867b2;
  --shadow: 0 18px 48px rgba(25, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef3f1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(217, 224, 231, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand.small {
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: white;
  background: var(--teal);
}

.main-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.main-nav a,
.dashboard-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.main-nav a:hover,
.dashboard-nav a:hover {
  color: var(--ink);
  background: #edf6f3;
}

.ghost-button,
.primary-button,
.secondary-button,
.zalo-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.ghost-button {
  background: #edf1f5;
}

.primary-button {
  color: white;
  background: var(--teal);
}

.secondary-button {
  color: var(--teal);
  background: #e4f5f2;
}

.zalo-button {
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 42vw);
  min-height: calc(100vh - 72px);
}

.search-panel {
  padding: 38px clamp(18px, 4vw, 56px) 56px;
}

.section-kicker {
  color: var(--teal);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.finder {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-field,
.tag-input-field,
.post-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.search-field input,
.tag-input-field input,
.review-form input,
.review-form select,
.post-form input,
.boost-controls input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: white;
}

.tag-input-field small {
  color: var(--muted);
  font-weight: 700;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

input[type="range"] {
  accent-color: var(--teal);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-weight: 800;
  font-size: 14px;
}

.result-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 34px 0 14px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.room-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 28px rgba(25, 32, 42, 0.08);
}

.room-card a {
  display: block;
}

.room-image {
  position: relative;
  height: 168px;
  overflow: hidden;
}

.room-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.room-card:hover img {
  transform: scale(1.04);
}

.tick {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.room-body {
  padding: 14px;
}

.room-body h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.room-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.room-meta strong {
  color: var(--coral);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span,
.roommate-grid span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #205b54;
  background: #e4f5f2;
  font-size: 12px;
  font-weight: 800;
}

.map-panel {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  padding: 18px 18px 18px 0;
}

.map-canvas {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255, 255, 255, 0.38) 1px, transparent 1px) 0 0 / 48px 48px,
    #cfe5dc;
  box-shadow: var(--shadow);
}

.map-road {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.18);
}

.road-a {
  width: 92%;
  height: 26px;
  left: -8%;
  top: 28%;
  transform: rotate(-18deg);
}

.road-b {
  width: 30px;
  height: 120%;
  right: 28%;
  top: -10%;
  transform: rotate(24deg);
}

.road-c {
  width: 72%;
  height: 22px;
  right: -14%;
  bottom: 24%;
  transform: rotate(12deg);
}

.map-label {
  position: absolute;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
  font-size: 13px;
}

.campus {
  left: 11%;
  top: 17%;
}

.beach {
  right: 9%;
  bottom: 11%;
}

.pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 4px solid white;
  border-radius: 50% 50% 50% 0;
  background: var(--coral);
  box-shadow: 0 8px 18px rgba(25, 32, 42, 0.24);
  transform: translate(-50%, -50%) rotate(-45deg);
  cursor: pointer;
}

.pin::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: white;
}

.map-preview {
  position: absolute;
  z-index: 5;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  width: 230px;
  padding: 10px;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.map-preview img {
  width: 72px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
}

.map-preview span {
  display: block;
  margin-top: 4px;
  color: var(--coral);
  font-weight: 900;
}

.detail-page,
.utilities-page {
  padding: 34px clamp(18px, 4vw, 58px) 60px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: stretch;
}

.media-stage {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border-radius: 8px;
  background: #d8dde1;
  box-shadow: var(--shadow);
}

.main-photo {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
}

.view-toggle {
  position: absolute;
  left: 18px;
  bottom: 18px;
}

.detail-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}

.detail-copy h1 {
  font-size: clamp(34px, 4vw, 58px);
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.verified {
  width: fit-content;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-weight: 900;
}

.thumb-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.thumb-row button {
  width: 88px;
  height: 68px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.thumb-row button:focus,
.thumb-row button:hover {
  border-color: var(--teal);
}

.thumb-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewer3d {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #f8fafb 0 12%, #d7e7e5 42%, #95b8b1 100%);
  perspective: 900px;
  cursor: grab;
}

.room-panorama {
  position: relative;
  width: min(68vw, 760px);
  height: 420px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, -8deg)) rotateY(var(--ry, -24deg));
  transition: transform 80ms linear;
}

.wall,
.floor,
.ceiling,
.bed,
.desk,
.window,
.rug {
  position: absolute;
  border-radius: 8px;
}

.wall-back {
  inset: 26px 80px 86px;
  background: linear-gradient(135deg, #f7f0e7, #e4eef0);
  transform: translateZ(-150px);
}

.wall-left {
  width: 180px;
  height: 310px;
  left: 44px;
  top: 46px;
  background: #d4e5dd;
  transform: rotateY(72deg) translateZ(65px);
}

.wall-right {
  width: 180px;
  height: 310px;
  right: 44px;
  top: 46px;
  background: #e6ddd2;
  transform: rotateY(-72deg) translateZ(65px);
}

.floor {
  left: 100px;
  right: 100px;
  bottom: 24px;
  height: 145px;
  background: repeating-linear-gradient(90deg, #bd9f78 0 28px, #c8ad89 28px 56px);
  transform: rotateX(68deg) translateZ(32px);
}

.ceiling {
  left: 120px;
  right: 120px;
  top: 0;
  height: 82px;
  background: #fafafa;
  transform: rotateX(-68deg) translateZ(20px);
}

.bed {
  left: 166px;
  bottom: 86px;
  width: 230px;
  height: 92px;
  background: linear-gradient(135deg, #ffffff 0 52%, #86a6bd 52%);
  box-shadow: 0 18px 0 #7a614c;
  transform: translateZ(24px) rotateX(54deg);
}

.desk {
  right: 180px;
  bottom: 112px;
  width: 150px;
  height: 58px;
  background: #8a6a4b;
  box-shadow: 0 28px 0 #5f4937;
  transform: translateZ(40px) rotateX(58deg);
}

.window {
  right: 202px;
  top: 76px;
  width: 132px;
  height: 110px;
  background: linear-gradient(135deg, #9fd1ef, #e9fbff);
  border: 10px solid white;
  transform: translateZ(-118px);
}

.rug {
  left: 286px;
  bottom: 66px;
  width: 180px;
  height: 70px;
  background: var(--coral);
  transform: translateZ(55px) rotateX(70deg);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  margin-top: 26px;
}

.price-table,
.contact-box,
.reviews,
.contract-library,
.roommate-board,
.post-form,
.analytics,
.boost-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(25, 32, 42, 0.07);
}

.price-table dl {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 0;
}

.price-table div {
  padding: 16px;
  border-radius: 8px;
  background: var(--soft);
}

.price-table dt {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.price-table dd {
  margin: 8px 0 0;
  font-weight: 900;
}

.contact-box {
  display: grid;
  gap: 12px;
}

.phone {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
}

.reviews {
  margin-top: 26px;
}

.review-form {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 10px;
  margin: 16px 0;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-item {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.review-item strong {
  display: block;
  margin-bottom: 6px;
}

.page-heading h1 {
  max-width: 900px;
}

.utility-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}

.notice {
  padding: 14px;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fff7df;
  color: #6f5514;
  font-weight: 700;
}

.contract-library article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.contract-library p,
.roommate-grid p,
.boost-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.roommate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.roommate-grid article {
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.roommate-grid div {
  display: flex;
  flex-wrap: wrap;
  align-content: end;
  gap: 6px;
}

.dashboard-page.is-active {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 72px);
}

.dashboard-nav {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 72px);
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.dashboard-main {
  padding: 34px clamp(18px, 4vw, 46px);
}

.dashboard-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-head h1 {
  font-size: clamp(32px, 4vw, 56px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.post-form {
  display: grid;
  gap: 14px;
}

.post-form input {
  margin-top: 8px;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-row div {
  padding: 16px;
  border-radius: 8px;
  background: var(--soft);
}

.metric-row span {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.metric-row strong {
  display: block;
  margin-top: 8px;
  font-size: 36px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 220px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
}

.bar-chart span {
  flex: 1;
  height: var(--h);
  min-width: 16px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--teal), var(--green));
}

.boost-panel {
  grid-column: span 2;
}

.boost-controls {
  display: flex;
  gap: 10px;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 14px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .home-shell,
  .detail-hero,
  .detail-layout,
  .utility-layout,
  .dashboard-page.is-active,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .map-panel,
  .dashboard-nav {
    position: relative;
    top: auto;
    height: 480px;
    padding: 0 18px 18px;
  }

  .price-table dl {
    grid-template-columns: repeat(2, 1fr);
  }

  .review-form,
  .boost-controls {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .boost-panel {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 38px;
  }

  .search-panel,
  .detail-page,
  .utilities-page,
  .dashboard-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .room-grid,
  .price-table dl,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .media-stage,
  .main-photo {
    min-height: 390px;
  }

  .detail-copy {
    padding: 20px;
  }
}
