:root {
  --bg: #f5f6f8; --kartu: #fff; --teks: #1d2433; --muted: #4b5563; --garis: #e3e6eb;
  --utama: #1f3864;
  --kavling: #f2c94c; --proses: #f2994a; --ready: #27ae60; --booking: #2f80ed; --terjual: #eb5757;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Lexend", Arial, Helvetica, sans-serif; font-size: 14px; background: var(--bg); color: var(--teks); }
a { color: var(--utama); }
.muted { color: var(--muted); }
.link { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0; }

header#topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--utama); color: #fff; padding: 8px 20px; position: sticky; top: 0; z-index: 15; }
header#topbar a, header#topbar .link { color: #fff; text-decoration: none; font-weight: bold; }
header#topbar nav { align-items: center; }
.brand img { background: #fff; border-radius: 8px; padding: 3px 8px; }
.menu { position: relative; }
.menu-isi { position: absolute; right: 0; top: calc(100% + 10px); background: #fff; border-radius: 10px; min-width: 220px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; }
.menu-isi[hidden] { display: none; }
header#topbar .menu-isi a, header#topbar .menu-isi .link { color: var(--teks); font-weight: normal; padding: 10px 12px; border-radius: 6px; text-align: left; }
header#topbar .menu-isi a:hover, header#topbar .menu-isi .link:hover { background: #eef2f8; }
.menu-isi hr { border: 0; border-top: 1px solid var(--garis); margin: 4px 0; }
.peta { width: 100%; height: 200px; border: 0; border-radius: 10px; display: block; margin: 4px 0 8px; }
header#topbar nav { display: flex; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: bold; font-size: 16px; }
.brand img { height: 40px; width: auto; display: block; }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }

.kartu { background: var(--kartu); border: 1px solid var(--garis); border-radius: 10px; padding: 16px; }
.login { max-width: 360px; margin: 10vh auto; }
.login h1 { text-align: center; }
label { display: block; font-weight: bold; margin: 12px 0 4px; }
input, select { width: 100%; padding: 9px 10px; border: 1px solid var(--garis); border-radius: 6px; font: inherit; }
button.utama { background: var(--utama); color: #fff; border: 0; border-radius: 6px; padding: 10px 14px; font: inherit; font-weight: bold; cursor: pointer; width: 100%; margin-top: 16px; }
button.utama:disabled { opacity: .6; }
.galat { color: #b42318; margin-top: 10px; }
.sukses { color: #067647; margin-top: 10px; }

.legenda { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 16px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.titik { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.s-kavling { background: var(--kavling); } .s-proses { background: var(--proses); }
.s-ready { background: var(--ready); } .s-booking { background: var(--booking); } .s-terjual { background: var(--terjual); }

.ringkas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.ringkas .kartu { padding: 12px 14px; }
.ringkas .angka { font-size: 24px; font-weight: bold; }

.grid-lokasi { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.kartu-lokasi { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.kartu-lokasi:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.kartu-lokasi .nama { font-weight: bold; font-size: 15px; }
.kartu-lokasi .sub { color: var(--muted); font-size: 12px; margin: 2px 0 10px; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--garis); }
.bar i { display: block; height: 100%; }
.angka-status { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 12px; }
.lencana { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #eef1f6; color: var(--muted); margin-left: 6px; font-weight: normal; }

.alat { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.alat input, .alat select { width: auto; min-width: 180px; }
.blok { margin-bottom: 18px; }
.blok h3 { font-size: 14px; margin: 0 0 8px; }
.kotak-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.kotak { width: 52px; height: 34px; border-radius: 5px; border: 0; color: #1d2433; font-size: 11px; font-weight: bold; cursor: pointer; }
.kotak.s-ready, .kotak.s-booking, .kotak.s-terjual { color: #fff; }
.kotak.redup { opacity: .18; }

.panel { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; justify-content: flex-end; z-index: 30; }
.panel[hidden] { display: none; }
.panel-box { background: #fff; width: min(420px, 100%); height: 100%; overflow-y: auto; padding: 20px; position: relative; }
.panel-tutup { position: absolute; right: 14px; top: 10px; font-size: 24px; background: none; border: 0; cursor: pointer; }
dl.rinci { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; margin: 12px 0; }
dl.rinci dt { color: var(--muted); }
dl.rinci dd { margin: 0; }

@media (max-width: 600px) {
  header#topbar { flex-wrap: wrap; }
  .alat input, .alat select { width: 100%; }
}

/* tombol kedua, siteplan, tambah blok */
button.kedua { background: #fff; color: var(--utama); border: 1px solid var(--utama); border-radius: 6px; padding: 8px 12px; font: inherit; font-weight: bold; cursor: pointer; }
button.kedua:hover { background: #eef2f8; }
button.kedua.lebar { width: 100%; margin-top: 12px; }
.alat-siteplan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.alat-siteplan select { width: auto; }
.pemisah { width: 1px; height: 22px; background: var(--garis); margin: 0 4px; }
.siteplan-scroll { overflow: auto; max-height: 78vh; background: #fff; border: 1px solid var(--garis); border-radius: 10px; }
.siteplan { position: relative; min-width: 300px; }
.siteplan img { display: block; width: 100%; height: auto; user-select: none; }
.judul-baris { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 24px 0 10px; }
.judul-baris h2 { margin: 0; }
.foto-lokasi { aspect-ratio: 4 / 3; margin: -16px -16px 12px; border-radius: 10px 10px 0 0; overflow: hidden; background: linear-gradient(135deg, #1f3864, #4a6fa5); display: flex; align-items: center; justify-content: center; }
.foto-lokasi img { width: 100%; height: 100%; object-fit: cover; }
.foto-lokasi span { color: rgba(255,255,255,.85); font-size: 26px; font-weight: bold; letter-spacing: 1px; }
.s-kosong { background: #fff; box-shadow: inset 0 0 0 1px #c9ced6; }
.bar i.s-kosong { background: #dfe3e8; box-shadow: none; }
.kotak.s-kosong { color: #6b7280; }
.tip-sp { position: fixed; z-index: 40; background: #1d2433; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
.sp-view { position: relative; overflow: hidden; height: calc(100vh - 150px); min-height: 360px; background: #fff;
  border: 1px solid var(--garis); border-radius: 10px; cursor: grab; touch-action: none; user-select: none; }
.sp-view canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; }
.sp-view.menggeser, .sp-view.menggeser canvas { cursor: grabbing !important; }

/* footer, logo login */
.kaki { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 24px; border-top: 1px solid var(--garis); }
.logo-login { display: block; height: 70px; margin: 4px auto 6px; }

/* status aktif lokasi */
.kartu-lokasi { position: relative; }
.lencana-aktif { display: inline-block; font-size: 11px; font-weight: bold; padding: 3px 10px; border-radius: 999px; border: 2px solid; background: #fff; }
.lencana-aktif.aktif { color: #067647; border-color: #27ae60; }
.lencana-aktif.mati { color: #b42318; border-color: #eb5757; }
.kartu-lokasi .lencana-aktif { position: absolute; top: 10px; left: 10px; z-index: 1; }
.kartu-lokasi.nonaktif { background: #f1f2f4; }
.kartu-lokasi.nonaktif > :not(.lencana-aktif) { filter: grayscale(1); opacity: .55; }

/* halaman lokasi: data kiri, siteplan kanan */
main.lebar { max-width: none; padding: 16px 20px 40px; }
.lokasi-dua { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.lokasi-kiri { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; padding-right: 4px; }
.lokasi-kiri h1 { margin: 8px 0 6px; font-size: 20px; }
.lokasi-kiri dl.rinci { grid-template-columns: 80px 1fr; font-size: 13px; margin: 8px 0 14px; }
.lokasi-kiri dl.rinci dd { word-break: break-word; }
.daftar-status { background: #fff; border: 1px solid var(--garis); border-radius: 10px; padding: 6px 12px; }
.baris-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--garis); }
.baris-status span { display: inline-flex; align-items: center; gap: 6px; }
.baris-status.total b { font-size: 16px; }
.kecil { font-size: 12px; padding: 6px 0 2px; }
.alat-kiri label { margin-top: 10px; }
.tombol-kiri { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
@media (max-width: 900px) {
  .lokasi-dua { grid-template-columns: 1fr; }
  .lokasi-kiri { position: static; max-height: none; overflow: visible; }
}

/* handphone */
@media (max-width: 600px) {
  header#topbar { padding: 6px 12px; flex-wrap: nowrap; }
  .brand img { height: 32px; }
  .brand span { display: none; }
  header#topbar nav { gap: 14px; font-size: 13px; }
  main, main.lebar { padding: 12px 12px 32px; }
  h1 { font-size: 19px; }
  .ringkas { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ringkas .angka { font-size: 20px; }
  .grid-lokasi { grid-template-columns: 1fr; }
  .lokasi-dua { gap: 12px; }
  .sp-view { height: 70vh; }
  .alat-siteplan .muted { font-size: 12px; flex-basis: 100%; }
  .daftar-status { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .baris-status { font-size: 13px; }
  .tombol-kiri { flex-direction: row; flex-wrap: wrap; }
  .tombol-kiri button { flex: 1 1 45%; }
  .kotak { width: 46px; }
  dl.rinci { grid-template-columns: 110px 1fr; }
  .panel-box { width: 100%; }
}
a.tombol-link { display: block; text-align: center; text-decoration: none; margin-bottom: 14px; }

/* Lexend di semua elemen form, info lokasi dipertegas */
button, input, select, textarea { font-family: inherit; }
.lokasi-kiri dl.rinci dt { color: var(--teks); font-weight: 500; }
.lokasi-kiri dl.rinci dd { color: var(--teks); font-weight: 600; }
.lokasi-kiri h1 { font-weight: 700; }
