/* PK 168 Real Asset — สไตล์หลัก (ใช้ทั้งหน้าเว็บและหลังบ้าน) */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f4f0;
  --surface: #ffffff;
  --ink: #1b1e21;
  --ink-2: #3a3f45;
  --muted: #6c727a;
  --line: #e7e3dc;
  --line-2: #d9d4ca;
  /* สีแบรนด์: แอดมินเปลี่ยนได้ในหน้าตั้งค่า (app/theme.php จะเขียนทับค่าพวกนี้) */
  --dark: #15181b;
  --dark-rgb: 21, 24, 27;
  --dark-2: #1f2428;
  --dark-3: #111416;
  --dark-hero: #1d2226;
  --dark-deep: #000000;
  --gold: #b08d57;
  --gold-rgb: 176, 141, 87;
  --gold-2: #96753f;
  --gold-hover: #96753f;
  --gold-ink: #b08d57;
  --gold-light: #b08d57;
  --gold-tint: #f1d7a8;
  --gold-soft: #f5eee2;
  --gold-grad-a: #c9a66b;
  --gold-grad-b: #8c6a35;
  --on-gold: #ffffff;
  --green: #1f4a3d;
  --green-rgb: 31, 74, 61;
  --green-2: #163a30;
  --green-3: #2f6b59;
  --green-ink: #1f4a3d;
  --green-soft: #e5efea;
  --on-green: #ffffff;
  --danger: #b83a2e;
  --danger-soft: #fbecea;
  --warn: #a36a12;
  --warn-soft: #fbf1df;
  --info: #2f5f8f;
  --info-soft: #e8f0f8;
  --line-green: #06c755;
  --wa-green: #1fa855;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 28, .05);
  --shadow: 0 1px 2px rgba(20, 24, 28, .04), 0 10px 30px rgba(20, 24, 28, .07);
  --shadow-lg: 0 24px 60px rgba(20, 24, 28, .18);
  --container: 1200px;
  --header-h: 76px;
  --font: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Noto Serif Thai", "Noto Sans Thai", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

.sr-only, .hp-field {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--dark); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-lg { margin-top: 40px; }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: 15px; line-height: 1.2; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled], .btn.is-loading { opacity: .7; pointer-events: none; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); color: var(--on-gold); box-shadow: 0 8px 20px rgba(var(--gold-rgb), .35); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--dark-deep); color: #fff; }
.btn-green { background: var(--green); color: var(--on-green); }
.btn-green:hover { background: var(--green-2); color: var(--on-green); }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { color: var(--ink); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: #fff; color: var(--dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9a2f25; color: #fff; }
.btn-line { background: var(--line-green); color: #fff; }
.btn-line:hover { background: #05a948; color: #fff; }
.btn-whatsapp { background: var(--wa-green); color: #fff; }
.btn-whatsapp:hover { background: #178a45; color: #fff; }
.btn .spinner, .spinner {
  width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2);
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.icon-btn.is-on { color: var(--gold-ink); border-color: var(--gold); background: var(--gold-soft); }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--gold-2); }
.link-arrow .icon { transition: transform .2s; }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line);
}
.is-home .site-header { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; color: #fff; transition: background .3s, color .3s, border-color .3s; }
.is-home .site-header.is-scrolled, .is-home .site-header.is-open { background: rgba(var(--dark-rgb), .94); border-color: rgba(255, 255, 255, .08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { color: inherit; }
.brand-logo { height: 44px; width: auto; max-width: 160px; object-fit: contain; border-radius: 10px; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-grad-a), var(--gold-grad-b)); color: var(--on-gold); font-family: var(--font-head);
  font-weight: 700; letter-spacing: .5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; font-weight: 600; }
.brand-text small { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; opacity: .65; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a:not(.btn) { padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; opacity: .85; transition: all .2s; }
.main-nav a:not(.btn):hover { opacity: 1; color: var(--gold-ink); }
.main-nav a.is-active { opacity: 1; color: var(--gold-ink); }
.is-home .main-nav a:not(.btn):hover, .is-home .main-nav a.is-active { color: var(--gold-light); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: inherit; }
.nav-toggle .icon { width: 26px; height: 26px; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--dark); color: #fff; padding: 12px 16px 20px; gap: 2px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .2s; box-shadow: var(--shadow-lg);
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .main-nav a:not(.btn) { padding: 12px 8px; border-radius: 8px; }
  .main-nav a:not(.btn):hover, .main-nav a.is-active { color: var(--gold-light); }
  .nav-cta { margin: 10px 0 0; }
}

/* ---------- section ---------- */
.section { padding: 72px 0; }
.section-tight { padding: 32px 0 64px; }
.section-soft { background: var(--bg-soft); }
.section-dark { background: var(--dark); color: #fff; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.section-head.center { justify-content: center; text-align: center; }
.section-head h2 { font-family: var(--font-head); font-size: clamp(26px, 3.2vw, 36px); margin: 0; }
.section-head .lead { color: var(--muted); margin: 8px 0 0; }
.section-dark .lead { color: rgba(255, 255, 255, .65); }
.eyebrow { font-size: 13px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin: 0 0 6px; }
.hero .eyebrow, .section-dark .eyebrow { color: var(--gold-light); }
@media (max-width: 640px) { .section { padding: 52px 0; } .section-head { align-items: flex-start; flex-direction: column; } }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 680px; display: flex; align-items: center; color: #fff; overflow: hidden;
  padding: calc(var(--header-h) + 40px) 0 72px;
  background:
    radial-gradient(1200px 500px at 85% 0%, rgba(var(--gold-rgb), .35), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(var(--green-rgb), .55), transparent 60%),
    linear-gradient(160deg, var(--dark-hero) 0%, var(--dark-3) 100%);
}
.hero:not(.has-image)::after {
  content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .6) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .6) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 12, 14, .55) 0%, rgba(10, 12, 14, .35) 40%, rgba(10, 12, 14, .75) 100%); }
.hero:not(.has-image) .hero-overlay { display: none; }
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-family: var(--font-head); font-size: clamp(32px, 5.2vw, 58px); max-width: 820px; margin-bottom: 16px; font-weight: 600; }
.hero-sub { font-size: clamp(16px, 1.8vw, 19px); max-width: 640px; color: rgba(255, 255, 255, .82); margin-bottom: 36px; }

/* ---------- ฟอร์มค้นหา ---------- */
.search-form { background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px 20px 20px; }
.search-bar { box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 20px; }
.search-tabs { display: flex; gap: 4px; padding: 6px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.search-tabs .tab { position: relative; cursor: pointer; }
.search-tabs input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.search-tabs span { display: block; padding: 6px 18px; border-radius: 999px; font-weight: 500; color: var(--muted); transition: all .2s; }
.search-tabs .tab.is-active span, .search-tabs input:checked + span { background: var(--dark); color: #fff; }
.search-tabs input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.search-fields { display: grid; grid-template-columns: 1.6fr 1.3fr auto; gap: 12px; align-items: end; }
.search-fields .field { margin: 0; }
.search-submit { height: 48px; padding: 0 28px; }
.price-range { display: flex; align-items: center; gap: 6px; }
.price-range input { min-width: 0; }
.price-range span { color: var(--muted); }
@media (max-width: 900px) {
  .search-fields { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .search-fields { grid-template-columns: 1fr; } }

/* ---------- ฟอร์มทั่วไป ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label, .label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); margin: 0; }
.req { color: var(--danger); }
input:not([type]), input[type=text], input[type=search], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .2s, box-shadow .2s; font-size: 15px;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.6; }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236c727a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .18); }
[aria-invalid=true] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: 13px; margin: 0; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
@media (max-width: 720px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } .form-row-4 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); flex-shrink: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; }

/* ---------- ประเภททรัพย์ ---------- */
.section-types { padding: 0; position: relative; z-index: 2; margin-top: -48px; }
.type-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.type-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  box-shadow: var(--shadow); transition: all .25s;
}
.type-tile:hover { transform: translateY(-4px); border-color: var(--gold); color: var(--ink); }
.type-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--gold-soft); color: var(--gold-2); }
.type-icon .icon { width: 26px; height: 26px; }
.type-name { font-weight: 600; font-size: 15px; }
.type-count { font-size: 13px; color: var(--muted); }
@media (max-width: 960px) { .type-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .type-grid { grid-template-columns: repeat(2, 1fr); } .section-types { margin-top: -32px; } }

/* ---------- การ์ดประกาศ ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-cards.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .grid-cards.grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 960px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-cards, .grid-cards.grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.property-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, #eeeae3, #e2ddd3); display: block; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.property-card:hover .card-media img { transform: scale(1.05); }
.card-noimg { display: grid; place-items: center; height: 100%; color: #b9b2a5; }
.card-noimg .icon { width: 40px; height: 40px; }
.badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badges.static { position: static; margin-bottom: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: #fff; color: var(--ink); line-height: 1.6;
}
.badge .icon { width: 13px; height: 13px; }
.badge-sale { background: var(--green); color: var(--on-green); }
.badge-rent { background: var(--gold); color: var(--on-gold); }
.badge-featured { background: var(--dark); color: var(--gold-tint); }
.badge-muted { background: var(--bg-soft); color: var(--ink-2); }
.badge-closed { background: var(--danger); color: #fff; }
.ribbon { position: absolute; inset: auto 0 0 0; background: rgba(184, 58, 46, .92); color: #fff; text-align: center; font-weight: 600; padding: 6px; font-size: 14px; }
.property-card.is-closed .card-media img { filter: grayscale(.5); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-type { font-size: 13px; color: var(--gold-2); font-weight: 500; margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.card-title { font-size: 17px; font-weight: 600; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-loc { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin: 0 0 14px; }
.card-loc .icon { color: var(--gold-ink); }
.specs { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); padding: 12px 0; border-top: 1px dashed var(--line); margin-top: auto; }
.specs li { display: flex; align-items: center; gap: 6px; }
.specs .icon { color: var(--muted); }
.specs span { color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.price { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0; }
.price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.card-foot .link-arrow { font-size: 14px; }

/* ---------- services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service { padding: 28px 24px; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius); background: rgba(255, 255, 255, .03); transition: all .25s; }
.service:hover { border-color: rgba(var(--gold-rgb), .6); background: rgba(var(--gold-rgb), .06); }
.service h3 { font-size: 19px; margin: 16px 0 8px; }
.service p { color: rgba(255, 255, 255, .65); font-size: 15px; margin: 0; }
.service-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: rgba(var(--gold-rgb), .16); color: var(--gold-light); }
.service-icon .icon { width: 26px; height: 26px; }
@media (max-width: 960px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .service-grid { grid-template-columns: 1fr; } }

.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 44px; border-radius: 24px; color: var(--on-green);
  background: radial-gradient(600px 300px at 100% 0%, rgba(var(--gold-rgb), .45), transparent 70%), linear-gradient(135deg, var(--green), var(--green-2));
}
.cta-band h2 { font-family: var(--font-head); font-size: clamp(24px, 3vw, 32px); }
.cta-band p { color: inherit; opacity: .8; margin: 0; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) { .cta-band { padding: 28px 20px; } .cta-actions .btn { flex: 1; } }

/* ---------- page hero / breadcrumb ---------- */
.page-hero { background: linear-gradient(160deg, var(--dark-hero), var(--dark-3)); color: #fff; padding: 48px 0 44px; }
.page-hero h1 { font-family: var(--font-head); font-size: clamp(26px, 4vw, 40px); margin-bottom: 6px; }
.page-hero p { color: rgba(255, 255, 255, .7); margin: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.page-hero .breadcrumb { color: rgba(255, 255, 255, .6); }
.breadcrumb .icon { width: 14px; height: 14px; }
.breadcrumb a:hover { color: var(--gold-ink); }
.page-hero .breadcrumb a:hover { color: var(--gold-light); }

.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 28px; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline label { font-size: 14px; color: var(--muted); white-space: nowrap; }
.field-inline select { height: 40px; min-width: 150px; font-size: 14px; }
@media (max-width: 600px) { .field-inline { width: 100%; } .field-inline select { flex: 1; } .field-inline label { min-width: 64px; } }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line); font-weight: 500; background: #fff;
}
.pagination a:hover { border-color: var(--gold); color: var(--gold-2); }
.pagination .is-current { background: var(--dark); color: #fff; border-color: var(--dark); }
.pagination span:not(.is-current) { border: 0; background: none; }

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: #fff; }
.empty-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-2); margin-bottom: 16px; }
.empty-icon .icon { width: 32px; height: 32px; }
.empty-state h3 { font-size: 20px; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 0 auto 20px; }

/* ---------- property detail ---------- */
.preview-bar { background: var(--warn); color: #fff; padding: 10px 0; font-size: 14px; }
.preview-bar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.preview-bar span { display: flex; gap: 8px; align-items: center; }
.detail-top { padding-top: 24px; }
.gallery { position: relative; display: grid; gap: 8px; border-radius: var(--radius); overflow: hidden; height: clamp(280px, 52vw, 540px); }
.gallery-1 { grid-template-columns: 1fr; }
.gallery-2 { grid-template-columns: 1fr 1fr; }
.gallery-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery-3 .gallery-item:first-child { grid-row: span 2; }
.gallery-4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery-4 .gallery-item:first-child { grid-row: span 2; }
.gallery-4 .gallery-item:nth-child(4) { grid-column: span 2; }
.gallery-5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery-5 .gallery-item:first-child { grid-row: span 2; }
.gallery-item { position: relative; display: block; background: #e9e5de; overflow: hidden; cursor: zoom-in; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item.is-hidden { display: none; }
.gallery-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 22px; font-weight: 600; }
.gallery-all { position: absolute; right: 16px; bottom: 16px; box-shadow: var(--shadow); }
.gallery-empty { display: grid; place-items: center; align-content: center; gap: 8px; background: var(--bg-soft); color: var(--muted); }
.gallery-empty .icon { width: 48px; height: 48px; }
@media (max-width: 720px) {
  .gallery { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; height: 300px; }
  .gallery-item:not(:first-child) { display: none; }
  .gallery-item:first-child { grid-row: auto !important; }
  .detail-top .container { padding: 0; }
  .detail-top .breadcrumb { padding: 0 16px; }
  .gallery { border-radius: 0; }
}

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
@media (max-width: 960px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-head h1 { font-family: var(--font-head); font-size: clamp(24px, 3.4vw, 34px); margin-bottom: 8px; }
.detail-loc { color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.detail-loc .icon { color: var(--gold-ink); margin-top: 4px; }
.detail-price { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; color: var(--green-ink); margin: 4px 0 24px; }
.detail-price small { font-size: 16px; color: var(--muted); font-weight: 400; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 36px; }
.facts li { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.facts .icon { width: 26px; height: 26px; color: var(--gold-ink); }
.facts span { display: block; font-size: 13px; color: var(--muted); }
.facts strong { font-weight: 600; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr 1fr; } .facts li { padding: 14px; } }
.block { margin-bottom: 40px; }
.block h2 { font-size: 21px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.prose { color: var(--ink-2); }
.prose p { margin-bottom: 1em; }
.amenities { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 20px; }
.amenities li { display: flex; gap: 8px; align-items: center; }
.amenities .icon { color: var(--on-green); background: var(--green); border-radius: 50%; padding: 3px; width: 20px; height: 20px; }
.loc-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; margin: 0 0 18px; }
.loc-list dt { font-size: 13px; color: var(--muted); }
.loc-list dd { margin: 0; font-weight: 500; }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; margin-bottom: 10px; background: var(--bg-soft); }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.detail-side { position: sticky; top: calc(var(--header-h) + 20px); }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.contact-label { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.agent { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.agent-avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-2); }
.agent strong { display: block; font-size: 17px; }
.agent span { color: var(--muted); font-size: 14px; }
.contact-actions { display: grid; gap: 10px; }
.share { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.share span { font-size: 14px; color: var(--muted); margin-right: auto; }
.contact-meta { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.mobile-contact-bar { display: none; }
@media (max-width: 960px) {
  .detail-side { position: static; }
  .mobile-contact-bar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
  }
  .mobile-contact-bar .btn { flex: 1; }
  .mobile-contact-bar .btn-whatsapp { flex: 0 0 52px; }
  body:has(.mobile-contact-bar) .site-footer { padding-bottom: 72px; }
}

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 10, .94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 86vh; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 80vh; object-fit: contain; margin: 0 auto; border-radius: 6px; }
.lightbox figcaption { color: rgba(255, 255, 255, .7); font-size: 14px; margin-top: 12px; }
.lb-close, .lb-nav { position: absolute; background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close .icon, .lb-nav .icon { width: 24px; height: 24px; }
@media (max-width: 600px) { .lb-nav { top: auto; bottom: 20px; transform: none; } }

/* ---------- about / contact ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center; }
.about-text h2 { font-family: var(--font-head); font-size: clamp(24px, 3vw, 32px); color: var(--ink); }
.stat-panel { display: grid; gap: 16px; }
.stat-panel div { padding: 24px 28px; border-radius: var(--radius); background: var(--bg-soft); border-left: 4px solid var(--gold); }
.stat-panel strong { font-family: var(--font-head); font-size: 40px; display: block; line-height: 1.1; color: var(--green-ink); }
.stat-panel span { color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: #fff; border-radius: var(--radius); padding: 28px 24px; border: 1px solid var(--line); }
.feature .service-icon { background: var(--gold-soft); color: var(--gold-2); }
.feature h3 { font-size: 18px; margin: 16px 0 6px; }
.feature p { color: var(--muted); font-size: 15px; margin: 0; }
.service-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; }
.service-list div { padding: 24px 0; border-bottom: 1px solid var(--line); }
.service-list h3 { display: flex; gap: 10px; align-items: center; font-size: 19px; }
.service-list h3 .icon { color: var(--gold-ink); }
.service-list p { color: var(--muted); margin: 0; }
@media (max-width: 960px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .feature-grid, .service-list { grid-template-columns: 1fr; } }

.contact-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.form-card { padding: 32px; }
.form-card h2, .info-card h2 { font-size: 22px; margin-bottom: 20px; }
.info-card { padding: 28px; margin-bottom: 20px; }
.info-list li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-list li:last-child { border: 0; }
.info-list .icon { width: 22px; height: 22px; color: var(--gold-ink); margin-top: 3px; }
.info-list span { font-size: 13px; color: var(--muted); }
.info-list p { margin: 0; font-weight: 500; }
.ref-property { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg-soft); margin-bottom: 20px; }
.ref-property img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; }
.ref-property small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } .form-card { padding: 22px; } }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: rgba(255, 255, 255, .72); padding: 64px 0 0; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.4fr; gap: 40px; }
.site-footer h3 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.site-footer ul li { margin-bottom: 8px; }
.site-footer a:hover { color: var(--gold-light); }
.brand-light { color: #fff; margin-bottom: 16px; }
.social { display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .15); }
.social a:hover { border-color: var(--gold-light); color: var(--gold-light); }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .icon { color: var(--gold-light); margin-top: 4px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 48px; padding: 20px 16px; font-size: 14px; color: rgba(255, 255, 255, .45); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- toast / confirm ---------- */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: 12px;
  background: #fff; box-shadow: var(--shadow-lg); border-left: 4px solid var(--green); font-size: 15px;
  animation: toast-in .3s ease;
}
.toast > .icon { width: 22px; height: 22px; color: var(--green); margin-top: 1px; }
.toast-error { border-color: var(--danger); }
.toast-error > .icon { color: var(--danger); }
.toast span { flex: 1; }
.toast-close { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 2px; }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

.confirm-dialog { border: 0; border-radius: 20px; padding: 28px; width: min(420px, calc(100vw - 32px)); text-align: center; box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgba(10, 12, 14, .5); backdrop-filter: blur(2px); }
.confirm-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); margin-bottom: 12px; }
.confirm-icon .icon { width: 28px; height: 28px; }
.confirm-dialog h2 { font-size: 20px; }
.confirm-dialog p { color: var(--muted); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.confirm-actions .btn { min-width: 120px; }

/* =========================================================
   หลังบ้าน (Admin)
   ========================================================= */
.admin-body { background: #f4f3ef; min-height: 100vh; }
.admin-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar {
  background: var(--dark); color: rgba(255, 255, 255, .72); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto;
}
.admin-sidebar .brand { color: #fff; padding: 4px 8px 24px; }
.admin-nav { display: grid; gap: 2px; }
.admin-nav-label { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(255, 255, 255, .35); padding: 16px 12px 6px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; transition: all .2s; }
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.is-active { background: rgba(var(--gold-rgb), .18); color: var(--gold-tint); }
.admin-nav .count { margin-left: auto; background: var(--gold); color: var(--on-gold); font-size: 12px; padding: 0 8px; border-radius: 999px; line-height: 20px; }
.admin-sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.admin-sidebar-foot a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.admin-sidebar-foot a:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.admin-topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 28px;
  background: rgba(244, 243, 239, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.admin-topbar h1 { font-size: 20px; margin: 0; }
.admin-topbar .spacer { flex: 1; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.admin-user .avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--on-gold); font-weight: 600; text-transform: uppercase; }
.admin-user .menu-btn { background: none; border: 0; cursor: pointer; padding: 8px; color: var(--muted); border-radius: 8px; display: flex; }
.admin-user .menu-btn:hover { color: var(--danger); background: var(--danger-soft); }
.admin-main { padding: 28px; }
.sidebar-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.sidebar-toggle .icon { width: 24px; height: 24px; }
.admin-backdrop { display: none; }
@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 270px; transform: translateX(-100%); transition: transform .25s; }
  .admin-sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .admin-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .4); }
  .sidebar-toggle { display: block; }
  .admin-topbar { padding: 0 16px; }
  .admin-main { padding: 20px 16px; }
  .admin-user .name { display: none; }
}

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-actions p { margin: 0; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: block; transition: all .2s; }
a.stat-card:hover { border-color: var(--gold); color: inherit; transform: translateY(-2px); }
.stat-card .stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--gold-soft); color: var(--gold-2); margin-bottom: 12px; }
.stat-card .stat-icon.green { background: var(--green-soft); color: var(--green-ink); }
.stat-card .stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-card .stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-card .stat-icon.dark { background: #ecebe8; color: var(--ink); }
.stat-card strong { display: block; font-size: 28px; line-height: 1.1; font-weight: 700; }
.stat-card span { font-size: 14px; color: var(--muted); }
@media (max-width: 1280px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } .stat-card strong { font-size: 24px; } }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17px; margin: 0; }
.panel-body { padding: 22px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel-grid .panel { margin-bottom: 0; }
@media (max-width: 1024px) { .panel-grid { grid-template-columns: 1fr; } }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-bottom: 24px; }
.dash-grid .panel { margin: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* กราฟแท่งแบบ CSS ล้วน */
.bar-chart { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 36px; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { height: 12px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: var(--w); background: linear-gradient(90deg, var(--gold), var(--gold-grad-a)); border-radius: 999px; transition: width .6s; }
.bar-row strong { text-align: right; }
.col-chart { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 20px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.col-bar { width: 100%; max-width: 48px; height: var(--h); min-height: 4px; background: linear-gradient(180deg, var(--green), var(--green-3)); border-radius: 8px 8px 4px 4px; position: relative; }
.col-bar span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 600; }
.col small { color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 110px 1fr 28px; } }
.donut-legend { display: grid; gap: 10px; }
.donut-legend li { display: flex; justify-content: space-between; font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }

/* ตาราง */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 12px 16px; background: #faf9f6; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfbf9; }
.table .thumb { width: 72px; min-width: 72px; max-width: none; height: 54px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); display: grid; place-items: center; color: #b9b2a5; }
.table .title-cell { min-width: 240px; }
.table .title-cell a { font-weight: 600; display: block; }
.table .title-cell small { color: var(--muted); display: block; }
.table .cell-status .pill { display: flex; width: fit-content; }
.table .cell-status .pill + .pill { margin-top: 4px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.table .actions form { margin: 0; }
.table .icon-btn { width: 34px; height: 34px; }
.table .icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.table tr.is-unread td { background: #fffbf3; }
.table tr.is-unread .title-cell a::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; margin-right: 8px; vertical-align: middle; }
@media (max-width: 860px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: grid; grid-template-columns: 72px 1fr; gap: 4px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table.responsive td { padding: 0; border: 0; }
  .table.responsive td.cell-thumb { grid-row: span 3; }
  .table.responsive td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .table.responsive td.cell-actions { grid-column: 1 / -1; padding-top: 10px; }
  .table.responsive .actions { justify-content: flex-start; flex-wrap: wrap; }
  .table.responsive .title-cell { min-width: 0; }
}

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-published, .pill-replied { background: var(--green-soft); color: var(--green-ink); }
.pill-draft, .pill-read { background: #ecebe8; color: var(--ink-2); }
.pill-hidden { background: var(--warn-soft); color: var(--warn); }
.pill-new { background: var(--gold-soft); color: var(--gold-2); }
.pill-sold, .pill-rented { background: var(--danger-soft); color: var(--danger); }
.pill-available { background: var(--info-soft); color: var(--info); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); align-items: center; }
.filter-bar input, .filter-bar select { height: 40px; font-size: 14px; width: auto; }
.filter-bar .input-icon { flex: 1; min-width: 200px; }
.filter-bar .input-icon input { width: 100%; }
.tabs-line { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs-line a { padding: 14px 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs-line a.is-active { color: var(--ink); border-color: var(--gold); font-weight: 500; }
.tabs-line a span { background: var(--bg-soft); border-radius: 999px; padding: 0 8px; font-size: 12px; margin-left: 4px; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu button, .dropdown-menu a {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  background: none; border: 0; cursor: pointer; font-size: 14px; text-align: left; color: var(--ink);
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--bg-soft); color: var(--ink); }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dropdown-menu form { margin: 0; }

/* ฟอร์มประกาศ */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.form-side { position: sticky; top: 88px; display: grid; gap: 20px; }
.form-side .panel { margin: 0; }
@media (max-width: 1100px) { .form-layout { grid-template-columns: 1fr; } .form-side { position: static; } }
.form-sticky-actions { display: grid; gap: 10px; }
.slug-field { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.slug-field span { padding: 0 12px; color: var(--muted); font-size: 14px; background: var(--bg-soft); height: 48px; display: flex; align-items: center; border-right: 1px solid var(--line-2); white-space: nowrap; }
.slug-field input { border: 0; border-radius: 0; }
.slug-field input:focus { box-shadow: none; }
.slug-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .18); }
.map-preview { margin-top: 4px; aspect-ratio: 16 / 7; }

.uploader { display: grid; gap: 14px; }
.dropzone {
  border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer;
  transition: all .2s; background: #fcfbf9;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: var(--gold-soft); }
.dropzone .icon { width: 36px; height: 36px; color: var(--gold-ink); margin: 0 auto 8px; display: block; }
.dropzone strong { display: block; }
.dropzone small { color: var(--muted); }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.image-item { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.image-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.image-item .img-tag { position: absolute; top: 8px; left: 8px; background: var(--dark); color: var(--gold-tint); font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.image-item .img-tag.new { background: var(--green); color: var(--on-green); left: auto; right: 8px; }
.image-item:not(:first-child) .img-tag.cover { display: none; }
.image-tools { display: flex; justify-content: space-between; padding: 6px; gap: 4px; }
.image-tools button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); }
.image-tools button:hover { border-color: var(--gold); color: var(--gold-2); }
.image-tools button.danger:hover { border-color: var(--danger); color: var(--danger); }
.image-tools button[disabled] { opacity: .35; pointer-events: none; }
.image-item[draggable=true] { cursor: grab; }
.image-item.is-dragging { opacity: .4; }

.setting-image { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.setting-image .preview { width: 160px; height: 90px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.setting-image .preview img { width: 100%; height: 100%; object-fit: contain; }
.setting-image .preview.cover img { object-fit: cover; }

/* ตั้งค่าสีแบรนด์ */
.preset-list { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; cursor: pointer; font-size: 14px; }
.preset:hover, .preset.is-active { border-color: var(--ink); }
.preset-dots { display: inline-flex; }
.preset-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; margin-left: -5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.preset-dots i:first-child { margin-left: 0; }
.color-field { display: flex; gap: 8px; }
.color-field input[type=color] { width: 52px; height: 48px; padding: 4px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; cursor: pointer; flex-shrink: 0; }
.color-field input[type=text] { font-family: ui-monospace, Consolas, monospace; text-transform: lowercase; }
.theme-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 6px; }
.tp-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--dark); color: rgba(255, 255, 255, .75); font-size: 14px; }
.tp-logo { width: 28px; height: 28px; border-radius: 8px; background: var(--gold); margin-right: auto; }
.tp-active { color: var(--gold-light); }
.tp-body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px; background: #fff; }
.tp-badge { padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.tp-sale { background: var(--green); color: var(--on-green); }
.tp-rent { background: var(--gold); color: var(--on-gold); }
.tp-price { color: var(--green-ink); font-size: 18px; }
.tp-link { color: var(--gold-ink); font-weight: 500; }
.tp-btn { margin-left: auto; padding: 8px 20px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-weight: 500; }

.message-box { white-space: pre-wrap; background: var(--bg-soft); padding: 20px; border-radius: 12px; line-height: 1.8; }
.meta-list { display: grid; gap: 14px; }
.meta-list div { display: flex; gap: 12px; }
.meta-list .icon { color: var(--gold-ink); margin-top: 3px; }
.meta-list span { display: block; font-size: 13px; color: var(--muted); }

/* หน้า login */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(800px 400px at 100% 0%, rgba(var(--gold-rgb), .25), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(var(--green-rgb), .45), transparent 60%), var(--dark-3);
}
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; padding: 36px 32px; box-shadow: var(--shadow-lg); }
.auth-card .brand { justify-content: center; margin-bottom: 24px; }
.auth-card h1 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--muted); padding: 8px; display: flex; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; display: flex; gap: 10px; }
.notice .icon { margin-top: 3px; }
.notice-info { background: var(--info-soft); color: var(--info); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
