:root{
  --bg:#0b1020; --card:#141a32; --muted:#c7cbe3; --text:#f5f7ff;
  --accent:#4da3ff; --ok:#39d98a; --warn:#ffcc66; --err:#ff6b6b;
  color-scheme: dark;
}
*{ box-sizing:border-box; }
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial,sans-serif;
}
.app{ display:grid; grid-template-columns:360px 1fr; min-height:100vh; }
@media (max-width:900px){
  .app{ grid-template-columns:1fr; grid-template-rows:auto 1fr; }
}
.sidebar{ background:var(--card); padding:16px 14px; border-right:1px solid #1f2747; }
.brand{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.brand .dot{ width:10px; height:10px; border-radius:50%; background:var(--ok); box-shadow:0 0 18px var(--ok); }
.brand h1{ font-size:18px; margin:0; }
.hint{ font-size:12px; color:var(--muted); opacity:.9; }
.row{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.search{ display:flex; gap:8px; margin:12px 0; position:relative; }
.search input{ flex:1; padding:10px 12px; border-radius:12px; border:1px solid #2a335e; background:#0c132b; color:var(--text); }
.search .btn{ white-space:nowrap; padding:10px 12px; }

.suggest{
  position:absolute; top:44px; left:0; right:0;
  background:#0c132b; border:1px solid #2a335e; border-radius:12px;
  overflow:hidden; z-index:5; max-height:220px; overflow-y:auto;
}
.suggest.hidden{ display:none; }
.suggest button{
  display:block; width:100%; text-align:left; padding:10px 12px;
  border:0; background:transparent; color:var(--muted); cursor:pointer;
}
.suggest button:hover{ background:#11193a; color:#c9d1ff; }
/* scrollbar gợi ý (tùy chọn) */
.suggest::-webkit-scrollbar{ width:8px; height:8px; }
.suggest::-webkit-scrollbar-thumb{ background:#27315a; border-radius:8px; }

label{ font-size:12px; color:var(--muted); }
input, textarea, select{
  width:100%; padding:10px 12px; border-radius:12px;
  border:1px solid #2a335e; background:#0c132b; color:var(--text);
}
textarea{ min-height:84px; resize:vertical; }

.actions{ display:flex; gap:8px; margin-top:8px; }
.btn{ border:0; border-radius:12px; padding:10px 12px; font-weight:700; cursor:pointer; }
.btn-primary{ background:var(--ok); color:#001a10; }
.btn-ghost{ background:transparent; color:var(--muted); border:1px dashed #2a335e; }
.btn-warn{ background:var(--warn); color:#2b1e00; }

.list{ margin-top:16px; }
.item{
  padding:10px; border:1px solid #2a335e; border-radius:12px; margin-bottom:8px; background:#0c132b;
}
.item .meta{ font-size:12px; color:var(--muted); }

.map{ position:relative; }
/* Chiều cao map: ưu tiên 100dvh cho mobile mới, fallback 100vh */
#map{ width:100%; height:100dvh; min-height:100vh; }

.legend{
  position:absolute; z-index:2; bottom:12px; left:12px;
  background:#0c132b; border:1px solid #2a335e; color:var(--muted);
  border-radius:12px; padding:8px 10px; font-size:12px;
}
.pill{
  display:inline-flex; align-items:center; gap:6px; padding:4px 8px;
  border-radius:999px; background:#11193a; border:1px solid #2a335e; color:#c9d1ff;
}
.req{ color:var(--warn); }
.error{ color:var(--err); font-size:12px; }
.hidden{ display:none; }

/* Leaflet layer switcher theme */
.leaflet-control-layers{
  background:#0c132b; color:var(--muted); border:1px solid #2a335e; border-radius:12px; box-shadow:none;
}
.leaflet-control-layers-expanded{ color:var(--text); }
.leaflet-control-layers label{ color:var(--muted); }
.leaflet-control-layers-separator{ border-top:1px solid #2a335e; }

/* Nhãn dán (label) nhỏ gọn trên ghim */
.leaflet-tooltip.lot-label{
  background:#0c132b; color:#f5f7ff; border:1px solid #2a335e; border-radius:10px;
  padding:6px 8px; font-weight:700; font-size:12px; box-shadow:0 4px 16px rgba(0,0,0,.35);
  pointer-events:none;
}
.leaflet-tooltip.lot-label .sub{
  display:block; font-weight:600; font-size:11px; color:#c7cbe3; margin-top:2px;
}

/* Popup chi tiết có gallery ảnh */
.popup-card{ max-width:340px; font-family:inherit; }
.popup-card .hero{
  width:100%; height:200px; object-fit:cover;
  border-radius:10px; border:1px solid #2a335e; display:block; margin-bottom:8px;
}
.popup-card .thumbs{ display:flex; gap:6px; margin-bottom:8px; overflow-x:auto; }
.popup-card .thumbs img{
  width:64px; height:48px; object-fit:cover; border-radius:6px; border:1px solid #2a335e; cursor:pointer;
}
.popup-card .title{ font-weight:800; font-size:14px; }
.popup-card .meta{ color:#c7cbe3; font-size:12px; margin:4px 0 8px; }
.popup-card .desc{ margin-bottom:8px; line-height:1.4; }
