* { box-sizing: border-box; }
body { margin: 0; background: #eeeeee; font-family: Arial, Helvetica, sans-serif; color: #222; }
a { color: #1b8ac6; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #ddd; position: sticky; top: 0; z-index: 20; }
.logo { font-size: 28px; font-weight: 800; color: #0a2896; }
.logo span { color: #702908; }
.logo:hover { text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.admin-link { font-size: 14px; }
.call-btn { background: #e60023; color: #fff !important; font-weight: 700; padding: 10px 18px; border-radius: 6px; font-size: 17px; }
.call-btn:hover { text-decoration: none; opacity: .92; }
.mainnav { background: #fff; border-bottom: 3px solid #f7b500; padding: 0 16px; }
.mainnav .tab { display: inline-block; background: #f7b500; color: #222; font-weight: 700; padding: 10px 22px; border-radius: 6px 6px 0 0; margin-top: 6px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 14px 12px 40px; }
h1 { font-size: 22px; margin: 8px 0 12px; }
.ward-tabs { background: #1b8ac6; border-radius: 6px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wtab { color: #fff; padding: 7px 14px; border-radius: 4px; font-weight: 600; font-size: 15px; }
.wtab:hover { text-decoration: none; background: rgba(255,255,255,.18); }
.wtab.active { background: #0d5d8a; }
.count-line { color: #555; font-size: 14px; margin: 6px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.12); display: flex; flex-direction: column; }
.card-img { position: relative; display: block; aspect-ratio: 4/3; background: #ddd; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: #888; background: #e2e2e2; min-height: 160px; }
.noimg.big { aspect-ratio: 4/3; max-width: 600px; margin: 0 auto; width: 100%; }
.badge-ward { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.55); color: #fff; padding: 4px 9px; border-radius: 4px; font-size: 13px; }
.badge-count { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; padding: 4px 9px; border-radius: 4px; font-size: 13px; }
.badge-own { position: absolute; bottom: 8px; left: 8px; background: #f7b500; color: #222; padding: 4px 9px; border-radius: 4px; font-size: 13px; font-weight: 700; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.35; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { background: #f2f2f2; border-radius: 12px; padding: 4px 10px; font-size: 14px; }
.chip.price { color: #d0021b; font-weight: 800; font-size: 16px; }
.chip.area { color: #d0021b; font-weight: 700; }
.date { color: #777; font-size: 13px; margin-left: auto; }
.addr { color: #444; font-size: 14px; }
.detail-link { margin-top: auto; text-align: right; }
.detail-link a { color: #f07d18; font-weight: 700; }
.paging { display: flex; gap: 6px; justify-content: center; margin: 22px 0 6px; flex-wrap: wrap; }
.paging a, .paging span { background: #fff; border: 1px solid #ccc; padding: 7px 13px; border-radius: 4px; color: #333; }
.paging .cur { background: #1b8ac6; color: #fff; border-color: #1b8ac6; font-weight: 700; }
.paging .off { color: #aaa; }
.footer { background: #333; color: #ddd; padding: 22px 16px; text-align: center; font-size: 14px; line-height: 1.7; }
.footer a { color: #fff; }
.float-btns { position: fixed; right: 14px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 30; }
.float-btns a { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.fb-call { background: #e60023; font-size: 22px; }
.fb-zalo { background: #0068ff; font-size: 14px; }
/* detail */
.crumbs { font-size: 14px; color: #666; margin-bottom: 6px; }
.gallery { max-width: 600px; margin: 0 auto; }
.g-main { position: relative; aspect-ratio: 4/3; background: #ddd; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.g-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 13px; }
.g-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.g-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.g-thumbs img { width: 74px; height: 56px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: .65; }
.g-thumbs img.on { opacity: 1; outline: 2px solid #1b8ac6; }
.info-line { background: #fff; border-radius: 8px; padding: 12px 14px; margin: 14px 0 8px; font-size: 15px; }
.red { color: #d0021b; }
.detail .addr { background: #fff; border-radius: 8px; padding: 10px 14px; }
.desc, .specs, .contact-box, .related { background: #fff; border-radius: 8px; padding: 14px; margin-top: 12px; }
.desc p { line-height: 1.55; margin: 6px 0; }
.specs table { width: 100%; border-collapse: collapse; }
.specs td { border-bottom: 1px solid #eee; padding: 8px 6px; font-size: 15px; }
.specs td:first-child { color: #666; width: 38%; }
.contact-box { text-align: center; }
.cb-title { font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.cb-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-call { background: #e60023; color: #fff; padding: 12px 22px; border-radius: 6px; font-weight: 700; border: 0; cursor: pointer; font-size: 16px; }
.btn-zalo { background: #0068ff; color: #fff; padding: 12px 22px; border-radius: 6px; font-weight: 700; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
.lb-close, .lb-prev, .lb-next { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 30px; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; }
/* admin */
.admin input, .admin select, .admin textarea { padding: 9px; margin: 4px 0; border: 1px solid #bbb; border-radius: 5px; font-size: 15px; }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin .note { color: #777; font-size: 13px; }
.own-item { background: #fff; border-radius: 6px; padding: 10px 12px; margin: 8px 0; }
@media (max-width: 640px) {
  .logo { font-size: 23px; }
  .call-btn { font-size: 15px; padding: 9px 12px; }
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
}
