/* property-bundle.css - สร้างอัตโนมัติจาก property.css, zoning-color.css, skeleton.css, icon-label-align.css, theme-system.css, happy-form-controls.css, toast-notifications.css, happy-popup.css, status-pill.css (App\Support\CssBundle) ห้ามแก้ไฟล์นี้ แก้ไฟล์ต้นทางแทน */
/* ---- property.css ---- */
/*
|--------------------------------------------------------------------------
| Property Platform CSS - Mobile First Design
|--------------------------------------------------------------------------
| 
| CSS สำหรับระบบแพลตฟอร์มอสังหาริมทรัพย์
| มีสุข คอร์ปอเรชั่น (2006)
|
*/

/* ===================================================================
   BASE STYLES - Mobile First (< 576px)
   =================================================================== */

body {
    font-family: var(--theme-font-family);
    background-color: var(--theme-bg-body);
    color: var(--theme-text-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    /* ลิงก์/คำยาวที่ไม่มีช่องว่าง (เช่น "แผนที่:https://goo.gl/maps/..." ในรายละเอียดทรัพย์) ตัดขึ้นบรรทัดใหม่ แทนการดันหน้ากว้างกว่าจอ
       บนมือถือตัวหนังสือใหญ่ทั้งหน้าถูกย่อจนเล็ก (user 2026-11-13) - มีผลเฉพาะคำที่ยาวเกินบรรทัด ข้อความปกติเหมือนเดิม */
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--theme-font-family-heading);
    /* color: var(--theme-text-heading); */
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--theme-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--theme-primary-hover);
}

/* ===================================================================
   NAVBAR STYLES
   =================================================================== */

.navbar {
    background-color: var(--theme-bg-header) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 0.5rem 0;
    height: 70px;
    transition: box-shadow 0.3s ease;
    will-change: box-shadow;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(2,63,37,0.15);
}

.navbar-brand {
    font-family: var(--theme-font-family-heading);
}

.brand-icon i {
    font-size: 1.75rem;
}

.brand-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--theme-primary);
    display: block;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.65rem;
    color: var(--theme-text-muted);
    display: block;
    line-height: 1;
}

.navbar-nav .nav-link {
    color: var(--theme-text-body) !important;
    font-weight: 500;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid #eee;
    font-size: 0.9375rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--theme-primary) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: #E3F3E9;
    color: #023F25;
}

.navbar-cta .btn {
    font-size: 0.8125rem;
}

/* Mobile menu background */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav {
        padding: 0.5rem 0;
    }
}

/* ===================================================================
   HERO SECTION
   =================================================================== */

.hero-property {
    background: linear-gradient(135deg, #035432 0%, #023F25 100%);
    min-height: 500px;
    position: relative;
    padding-top: 1rem;
    padding-bottom: 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/no-image.svg');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(3,84,50,0.92) 0%, rgba(2,63,37,0.88) 100%);
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 0.9375rem;
}

/* Hero Tabs */
.hero-tabs {
    margin-bottom: 1.5rem;
}

.btn-tab {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-tab:hover {
    background: rgba(255,154,0,0.4);
    border-color: #FF9A00;
    color: white;
}

.btn-tab.active {
    background: #FF9A00;
    border-color: #FF9A00;
    color: #023F25;
    font-weight: 600;
}

/* Search Box */
.search-box {
    border-radius: 16px;
    background: white;
}

.search-box .form-select,
.search-box .form-control {
    border-radius: 8px;
    border: 1px solid #E3F3E9;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.search-box .form-select:focus,
.search-box .form-control:focus {
    border-color: #035432;
    box-shadow: 0 0 0 3px rgba(3,84,50,0.15);
}

.search-box .btn-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

/* Hero Stats */
.hero-stats .stat-number {
    font-family: var(--theme-font-family-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Hero Wave */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    line-height: 0;
}

.hero-wave svg {
    width: 100%;
    height: 60px;
}

/* ===================================================================
   PROPERTY CARD - IMAGE CAROUSEL
   =================================================================== */

.pc-carousel-track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pc-carousel-track::-webkit-scrollbar {
    display: none;
}
.pc-slide {
    scroll-snap-align: start;
}

.pc-nav {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}
.pc-nav:hover {
    background: #fff;
}
.pc-nav-prev { left: 8px; }
.pc-nav-next { right: 8px; }

@media (min-width: 768px) {
    .pc-nav {
        display: flex;
    }
    .property-card-modern:hover .pc-nav {
        opacity: 1;
    }
}

.pc-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
}
.pc-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    transition: background 0.2s ease, width 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
}
.pc-dot.active {
    background: #fff;
    width: 14px;
    border-radius: 3px;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .property-card-modern .pc-has-contract-badge .pc-status-badge-wrap {
        left: 0 !important;
        right: auto !important;
        justify-content: flex-start !important;
    }

    .property-card-modern .pc-has-contract-badge .pc-contract-badge-wrap {
        bottom: 2.45rem !important;
    }

    .property-card-modern .pc-has-contract-badge .pc-contract-label {
        display: none;
    }

    .property-card-modern .pc-has-contract-badge .pc-status-badge-wrap,
    .property-card-modern .pc-has-contract-badge .pc-contract-badge-wrap {
        align-items: flex-start !important;
    }

    .property-card-modern .pc-has-contract-badge .pc-status-badge,
    .property-card-modern .pc-has-contract-badge .pc-contract-end-badge,
    .property-card-modern .pc-has-contract-badge .pc-contract-days-badge {
        max-width: 100%;
        justify-content: flex-start !important;
        text-align: left;
    }
}

/* ===================================================================
   SEARCH RESULTS - GRID FILLER CARD
   (fills the gap when the last row of results doesn't reach 4 columns)
   =================================================================== */
.pc-filler-card {
    border: 1.5px dashed #d1d5db;
    border-radius: 16px;
    background: #fafafa;
    color: #9ca3af;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.5;
    padding: 1.5rem;
    min-height: 200px;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.pc-filler-card i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: #d1d5db;
    transition: color 0.2s ease;
}
.pc-filler-card:hover,
.pc-filler-card:hover i {
    border-color: var(--theme-primary, #035432);
    color: var(--theme-primary, #035432);
}
.pc-filler-card:hover {
    background: rgba(var(--theme-primary-rgb, 3, 84, 50), 0.03);
}

/* ===================================================================
   PROPERTY CARD - FEATURED ("แนะนำ") BADGE
   =================================================================== */
.pc-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #FFC873 0%, #FF9A00 100%);
    color: #5c2d00;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.2px;
    padding: 3px 10px 3px 3px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(255, 154, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.pc-featured-badge__icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #7a3d00;
    flex-shrink: 0;
}

/* ===================================================================
   ป้าย Verified (ตราทอง) บนการ์ดรายการ = ประกาศที่มีสุขดูแล (CEO ผ่าน user 2026-11-12)
   มุมล่างขวาของการ์ด: เดสก์ท็อปอยู่ท้ายแถวห้อง/ขนาดพื้นที่ (การ์ดแคบ = ขึ้นบรรทัดใหม่ชิดขวา ไม่ตัดขนาดพื้นที่)
   มือถือ (การ์ดแนวนอน) ใช้ป้ายตัวที่สองในแถวราคา ชิดขวา ที่ไม่พอขึ้นบรรทัดใหม่ (บล็อก max-width: 767.98px)
   ประกาศฟรีไม่มีป้าย. รูปตรา = assets/images/badges/verified-seal.svg, markup = components/property/verified-badge
   =================================================================== */
.pc-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px 0 2px;
    border-radius: 999px;
    background: #EDBE45;
    background: linear-gradient(180deg, #FFF6CF 0%, #F9DE80 38%, #EDBE45 62%, #D9A02A 100%);
    box-shadow: inset 0 0 0 1px #B7811C, inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 6px rgba(201, 143, 29, .35);
    color: #4A2E00;
    font: 800 10.5px/1 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.pc-verified img { width: 18px; height: 18px; display: block; flex-shrink: 0; }
/* สีเงิน = ค่าบริหารต่ำกว่า 20% (Property::verifiedTier(), user 2026-11-26) - ทองยังเด่นกว่า เงินรองลงมา
   อยู่ก่อน --icon ตั้งใจ: ตราอย่างเดียวต้องไม่มีพื้นแคปซูล (ลำดับเดียวกันชนะ) */
.pc-verified--silver {
    background: #C9D0D9;
    background: linear-gradient(180deg, #FFFFFF 0%, #EEF1F5 38%, #CBD2DB 62%, #AAB3BF 100%);
    box-shadow: inset 0 0 0 1px #8B95A2, inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 6px rgba(100, 116, 139, .32);
    color: #27303B;
}
/* ขนาดใหญ่: หัวหน้ารายละเอียดทรัพย์ */
.pc-verified--lg { height: 30px; gap: 6px; padding: 0 13px 0 3px; font-size: 13px; letter-spacing: .08em; }
.pc-verified--lg img { width: 24px; height: 24px; }
/* ตราอย่างเดียว: แถบจองมือถือที่มีชิป 3 อัน */
.pc-verified--icon { width: 24px; height: 24px; padding: 0; gap: 0; justify-content: center; background: none; box-shadow: none; }
.pc-verified--icon img { width: 24px; height: 24px; filter: drop-shadow(0 1px 2px rgba(156, 106, 14, .35)); }
.pc-verified--silver.pc-verified--icon img { filter: drop-shadow(0 1px 2px rgba(71, 85, 105, .35)); }

.property-card-modern .pc-verified { margin-left: auto; flex-shrink: 0; pointer-events: none; }
/* ตัวในแถวราคามีไว้สำหรับมือถือ (การ์ดแนวนอน, บล็อก max-width: 767.98px) - จอใหญ่ใช้ตัวท้ายแถวขนาดพื้นที่ */
@media (min-width: 768px) {
    .property-card-modern .pc-row-price .pc-verified { display: none; }
}
/* แถวล่างสูงเท่าป้าย (22px + pt-2); overflow visible ให้เงาป้ายไม่ถูกตัด */
.property-card-modern.pc-is-verified .pc-row-features {
    min-height: calc(22px + .5rem) !important;
    flex-wrap: wrap !important;
    row-gap: 6px !important;
    overflow: visible !important;
}

/* หน้ารายละเอียด: ป้าย Verified เหนือชื่อทรัพย์ (สิ่งแรกที่อ่านหลังดูรูป) - กว้างเท่าป้าย ให้กรอบบทเรียนตัวแทนพอดีป้าย */
.pd-verified-row {
    display: flex;
    width: max-content;
    max-width: 100%;
}
/* แถวบนสุดของการ์ดหัวทรัพย์ (2026-11-13): Verified ซ้าย · แชร์ + รายการโปรดขวา แถวเดียวกัน (ประกาศฟรีไม่มี Verified: ปุ่มยังชิดขวา)
   ปุ่มเป็น .pd-badge สีทอง (ใต้ sm เหลือแต่ไอคอน) จึงไม่ดันป้าย Verified บนมือถือ 320px */
.pd-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.pd-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    margin-left: auto;
}
/* แถบจองล่างจอมือถือ (#pdMobileCta): ป้ายชิดขวาสุดของแถวชิป ตรงเหนือราคา */
.pd-mobile-cta .pd-cta-badges .pc-verified { margin-left: auto; flex-shrink: 0; }

/* กล่อง "มีสุขดูแลประกาศนี้" (มือถือใต้ปุ่มติดต่อ, เดสก์ท็อปท้ายการ์ดจอง) - โทนทองเดียวกับป้าย Verified */
.pd-trust {
    margin: 12px 0 0;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid;
}
.pd-trust--managed {
    background: #FFFBF0;
    background: linear-gradient(180deg, #FFF6DC 0%, #FFFCF4 55%, #fff 100%);
    border-color: #EBCF86;
    box-shadow: 0 2px 10px rgba(201, 143, 29, .10);
}
/* กล่องเดียวกันโทนเงิน (ค่าบริหารต่ำกว่า 20%) - ข้อความเหมือนกล่องทอง ต่างแค่สี */
.pd-trust--silver {
    background: #F6F8FA;
    background: linear-gradient(180deg, #EEF1F5 0%, #F8F9FB 55%, #fff 100%);
    border-color: #CDD4DD;
    box-shadow: 0 2px 10px rgba(100, 116, 139, .10);
}
.pd-trust--free { background: linear-gradient(180deg, #f3f7fd 0%, #fff 100%); border-color: #d9e4f3; }
.pd-trust__head { display: flex; align-items: center; gap: 12px; }
.pd-trust__headtext { min-width: 0; }
.pd-trust__seal {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: block;
    filter: drop-shadow(0 2px 3px rgba(156, 106, 14, .3));
}
.pd-trust__eyebrow {
    display: block;
    margin-bottom: 1px;
    color: #8A5C0A;
    /* ข้อความไทย "ตรวจสอบแล้ว" (เดิม VERIFIED): ไม่เว้นช่องตัวอักษร ไม่งั้นสระ/วรรณยุกต์แยกจากพยัญชนะ */
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}
.pd-trust__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.pd-trust__icon .bi { font-family: bootstrap-icons; line-height: 1; font-size: 18px; }
.pd-trust__icon .bi::before { vertical-align: 0; }
.pd-trust--free .pd-trust__icon { background: #2563eb; box-shadow: 0 2px 6px rgba(37, 99, 235, .22); }
.pd-trust__title { font-weight: 700; font-size: 0.95rem; line-height: 1.4; color: #0f172a; }
.pd-trust__sub { font-size: 0.8rem; line-height: 1.45; color: #475569; }
/* เบอร์เจ้าของ (ประกาศฟรีที่เจ้าของลงเอง) - แตะแล้วโทร · การ์ดขาวในกล่องฟ้า ไอคอนโทรเขียว ไม่มีแถบสีด้านซ้าย */
.pd-trust__call {
    display: flex; align-items: center; gap: 10px;
    margin: 12px 0 0; padding: 10px 12px;
    border-radius: 12px; border: 1px solid #d9e4f3; background: #fff;
    color: #0f172a; text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.pd-trust__call:hover, .pd-trust__call:focus { color: #0f172a; border-color: #9fc0ea; box-shadow: 0 4px 12px -6px rgba(37, 99, 235, .35); }
.pd-trust__call:focus { outline: none; }
.pd-trust__call:focus-visible { outline: 3px solid rgba(255, 154, 0, .6); outline-offset: 2px; }
.pd-trust__call-ico {
    width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    color: #fff; background: #16a34a; box-shadow: 0 2px 6px rgba(22, 163, 74, .25);
}
.pd-trust__call-ico .bi { font-family: bootstrap-icons; line-height: 1; font-size: 16px; }
.pd-trust__call-ico .bi::before { vertical-align: 0; }
.pd-trust__call-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pd-trust__call-label, .pd-trust__call-name { font-size: 0.78rem; line-height: 1.45; color: #475569; }
/* ชื่อยาวขึ้นบรรทัดใหม่ที่เว้นวรรค ไม่หักกลางคำ (overflow-wrap: break-word ตัดเฉพาะคำเดียวที่ยาวเกินกล่อง) */
.pd-trust__call-name { overflow-wrap: break-word; }
/* layouts/property ไม่โหลดฟอนต์เว็บ ตัวเลขจะเป็น Times New Roman - ใช้ชุด sans เดียวกับ .pd-trust__eyebrow / .nvd-num */
.pd-trust__call-num { font: 800 1.1rem/1.3 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: .02em; color: #0f172a; white-space: nowrap; }
/* จอแคบมาก (และตัวอักษรใหญ่) เบอร์ต้องอยู่บรรทัดเดียว - ไอคอนโทรเป็นแค่ตัวประกอบ เอาที่ให้ตัวเลขก่อน */
@media (max-width: 359px) {
    .pd-trust__call { gap: 0; }
    .pd-trust__call-ico { display: none; }
}
.pd-trust__list {
    list-style: none;
    margin: 12px 0 0;
    padding: 10px 0 0;
    border-top: 1px dashed;
    display: grid;
    gap: 6px;
}
.pd-trust--managed .pd-trust__list { border-color: #EBCF86; }
.pd-trust--free .pd-trust__list { border-color: #d9e4f3; }
.pd-trust__list li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; line-height: 1.45; color: #334155; }
/* ไอคอนสูงเท่าบรรทัดแรก (1.45em x 0.82rem) แล้วจัดกลาง; ตัวอักษรไทยนั่งต่ำกว่ากลางบรรทัดราว 1px จึงดันไอคอนลง 1px */
.pd-trust__list .bi { font-family: bootstrap-icons; line-height: 1; font-size: 14px; flex-shrink: 0; display: flex; align-items: center; height: 19px; position: relative; top: 1px; }
.pd-trust--managed .pd-trust__list .bi { color: #C98F1D; }
.pd-trust--silver .pd-trust__seal { filter: drop-shadow(0 2px 3px rgba(71, 85, 105, .3)); }
.pd-trust--silver .pd-trust__eyebrow { color: #56606C; }
.pd-trust--silver .pd-trust__list { border-color: #CDD4DD; }
.pd-trust--silver .pd-trust__list .bi { color: #7D8794; }
.pd-trust--free .pd-trust__list .bi { color: #64748b; }

/* ===================================================================
   PROPERTY TYPES SECTION
   =================================================================== */

.property-types-section {
    padding: 0.75rem 0;
}

.property-type-card .card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.property-type-card:hover .card {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle i {
    font-size: 1.25rem;
}

.type-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--theme-text-heading);
}

/* ===================================================================
   SECTION STYLES
   =================================================================== */

section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.875rem;
}

.bg-primary-light {
    background-color: var(--theme-primary-light) !important;
}

.bg-success-light {
    background-color: var(--theme-success-light) !important;
}

.bg-warning-light {
    background-color: var(--theme-warning-light) !important;
}

.bg-info-light {
    background-color: var(--theme-info-light) !important;
}

.bg-danger-light {
    background-color: var(--theme-danger-light) !important;
}

/* ===================================================================
   PROPERTY CARD
   =================================================================== */

.property-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.property-image {
    position: relative;
    padding-top: 70%;
    overflow: hidden;
}

.property-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* property-card-modern ใช้ aspect-ratio: 4/3 inline ไม่ต้องการ padding-top trick */
.property-card-modern .property-image {
    padding-top: 0;
    aspect-ratio: 4 / 3;
}

/* aspect-ratio ใช้ไม่ได้บน iOS < 15 / Chrome < 88 - กล่องรูปสูง 0px แถบรูป (h-100) จึงหายทั้งแถบ
   ใช้ padding-top trick แล้ววางแถบรูปเต็มกล่องแทน (จอ < 768px เป็นการ์ดแนวนอน รูปยืดตามความสูงการ์ด
   จึงวางแถบรูปเต็มกล่องอย่างเดียว) */
@supports not (aspect-ratio: 1 / 1) {
    .property-card-modern .property-image > .pc-carousel-track {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
    @media (min-width: 768px) {
        .property-card-modern .property-image {
            height: 0;
            padding-top: 75%;
        }
    }
}

.property-card-modern .property-image > a {
    display: block;
    height: 100%;
}

.property-card-modern .property-image img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-card:hover .property-image img,
.property-card-modern:hover .property-image .pc-slide.active img {
    transform: scale(1.05);
}

.property-badges .badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.375rem 0.5rem;
}

.btn-favorite {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.3s ease;
}

.btn-favorite:hover,
.btn-favorite.active {
    background: #ef4444;
    color: white;
}

.property-type-label .badge {
    font-size: 0.625rem;
}

.property-price {
    font-size: 1rem;
    font-family: var(--theme-font-family-heading);
}

.property-title a {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.property-location {
    font-size: 0.75rem;
}

.property-features {
    font-size: 0.6875rem;
}

.property-features span {
    display: inline-flex;
    align-items: center;
}

/* Listing Filter Tabs */
.btn-filter {
    background: #E3F3E9;
    border: none;
    color: #023F25;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.btn-filter:hover {
    background: #FF9A00;
    color: #023F25;
}

/* ================================================
   Property Card - Horizontal Layout on Mobile
   (Agoda/Airbnb-style: image left, details right)
   ================================================ */
@media (max-width: 767.98px) {
    .property-card-modern {
        flex-direction: row;
        height: auto !important;
        border-radius: 14px !important;
        box-shadow: 0 1px 2px rgba(3,84,50,0.04), 0 4px 16px rgba(3,84,50,0.08) !important;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .property-card-modern:active {
        transform: scale(0.985);
        box-shadow: 0 1px 2px rgba(3,84,50,0.06), 0 2px 8px rgba(3,84,50,0.1) !important;
    }

    .property-card-modern .property-image {
        width: 136px;
        flex: 0 0 136px;
        aspect-ratio: unset !important;
        align-self: stretch;
    }

    .property-card-modern .property-image img {
        transition: transform 0.4s ease;
    }

    .property-card-modern .card-body {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.75rem 0.85rem !important;
        justify-content: flex-start;
        border-left: 1px solid rgba(3,84,50,0.06);
    }

    /* Reorder content: title → location → features → price/zone pinned to bottom
       min-height (not auto) keeps 1-line and 2-line titles the same box height, so
       cards in the same row line up instead of some going short/tall by title length. */
    .property-card-modern .pc-title {
        order: 1;
        height: auto !important;
        min-height: 2.38rem !important;
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        color: #16241d;
        margin-bottom: 0.3rem !important;
    }
    .property-card-modern .pc-code { display: none; }

    /* Verified: การ์ดแนวนอน แถวล่างสุดคือราคา - ป้ายเป็นชิ้นหนึ่งในแถวราคา ชิดขวา (ตัวในแถวขนาดพื้นที่ซ่อน)
       ลำดับการยอมเมื่อที่ไม่พอ: "/ เดือน" ขึ้นบรรทัดใต้ราคาก่อน → ป้ายขึ้นบรรทัดใหม่ชิดขวา → ราคาไม่ถูกตัดเลย
       (เดิมป้ายลอย position:absolute + เว้นขวา 92px ตายตัว: มือถือตั้งตัวหนังสือใหญ่ป้ายกว้างเกิน 92px ราคาเหลือ "฿120,...", user 2026-11-13)
       ราคา: flex-basis 0 + min-width min-content = ขึ้นบรรทัดตามความกว้างตัวเลขราคา ไม่ใช่ราคา + "/ เดือน" */
    .property-card-modern .pc-row-features .pc-verified { display: none; }
    .property-card-modern .pc-row-price .pc-verified { display: inline-flex; margin-left: auto; }
    .property-card-modern.pc-is-verified .pc-row-features {
        min-height: 1.5rem !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    .property-card-modern.pc-is-verified .pc-row-price {
        min-height: calc(22px + .5rem);
        flex-wrap: wrap;
        align-items: flex-end !important; /* Bootstrap .align-items-center เป็น !important */
        column-gap: 6px;
        row-gap: 4px;
    }
    .property-card-modern .pc-row-price > div:first-child { flex-wrap: wrap; row-gap: 0; }
    .property-card-modern.pc-is-verified .pc-row-price > div:first-child {
        flex: 1 1 0;
        min-width: min-content !important; /* ทับ style="min-width: 0" ในมาร์กอัป */
    }
    .property-card-modern.pc-is-verified .pc-row-price h5 { overflow: visible; text-overflow: clip; }

    .property-card-modern .pc-row-location {
        order: 2;
        margin-bottom: 0.35rem !important;
    }
    .property-card-modern .pc-row-location i { color: #a3aeae !important; }
    .property-card-modern .pc-row-location span { font-size: 0.75rem !important; }

    .property-card-modern .pc-row-features {
        order: 3;
        gap: 0.35rem !important;
    }
    .property-card-modern .pc-feat-chip {
        background: #f2f6f4;
        border-radius: 6px;
        padding: 0.15rem 0.4rem;
        font-size: 0.7rem !important;
        font-weight: 500;
    }

    .property-card-modern .pc-row-price {
        order: 4;
        margin-top: auto !important;
        padding-top: 0.5rem;
    }
    .property-card-modern .pc-row-price h5 {
        font-size: 1rem !important;
        letter-spacing: -0.01em;
    }
    .property-card-modern .pc-price-suffix.d-none {
        display: inline !important;
    }
    /* Compact overlay badges to fit the narrower image column */
    .property-card-modern .property-image .badge {
        font-size: 0.58rem !important;
        padding: 0.2rem 0.4rem !important;
        border-radius: 5px !important;
        max-width: 100%;
        flex-shrink: 1 !important;
        min-width: 0;
    }
    /* มือถือตั้งตัวหนังสือใหญ่ ป้ายบนรูปกว้างเกินคอลัมน์รูป (user 2026-11-13: "โครงการในอนาค" ถูกตัดขาด, "อีก 1 เดือน 18 ...")
       ข้อความขึ้นบรรทัดใหม่ในป้าย ("โครงการ / ในอนาคต") ไม่ตัดทิ้ง - ชื่อสถานะยาวมีแค่โครงการในอนาคต ซึ่งไม่มีป้ายสัญญาซ้อนด้านบน
       จอปกติพอดีบรรทัดเดียวเหมือนเดิม */
    .property-card-modern .pc-status-badge { white-space: normal !important; text-align: left; }
    .property-card-modern .pc-move-in-badge { white-space: normal !important; text-align: left; line-height: 1.25; }
    .property-card-modern .pc-status-name { min-width: 0; }
    .property-card-modern .pc-contract-badge-wrap .text-truncate {
        white-space: normal;
        overflow: visible;
        line-height: 1.25 !important;
    }

    /* Contract end-date badges: image column is only 136px here, so drop the
       label and let the remaining icon+date truncate instead of bleeding
       past the image edge. */
    .property-card-modern .pc-contract-label {
        display: none;
    }
    .property-card-modern .pc-contract-end-badge,
    .property-card-modern .pc-contract-days-badge {
        min-width: 0;
    }

    /* At 136px wide, the property-status badge (bottom-end) and the
       contract-end badges (bottom-start) don't both fit on one row and
       overlap. Stack them instead: contract-end badges above, status badge
       at the very bottom, both left-aligned. */
    .property-card-modern .pc-status-badge-wrap {
        left: 0 !important;
        right: auto !important;
        justify-content: flex-start !important;
    }
    .property-card-modern .pc-contract-badge-wrap {
        bottom: 2.1rem !important;
    }

    /* Each pill sizes to its own text (no shared/fixed width) and stays
       left-aligned, both container and text. */
    .property-card-modern .pc-status-badge-wrap,
    .property-card-modern .pc-contract-badge-wrap {
        align-items: flex-start !important;
    }
    .property-card-modern .pc-status-badge,
    .property-card-modern .pc-contract-end-badge,
    .property-card-modern .pc-contract-days-badge {
        justify-content: flex-start !important;
        text-align: left;
    }
    .property-card-modern .btn-favorite {
        width: 26px !important;
        height: 26px !important;
    }
    .property-card-modern .btn-favorite i {
        font-size: 0.7rem !important;
    }

    .property-card-modern:hover {
        transform: none !important;
    }
}

/* จอแคบกว่า 360px (มือถือเล็ก / Chrome Android ที่ขยายทั้งหน้า 150% ทำให้จอเหลือ ~270px): รูปแคบลง เหลือที่ให้ชื่อ/ราคา */
@media (max-width: 359.98px) {
    .property-card-modern .property-image {
        width: 112px;
        flex-basis: 112px;
    }
}

.btn-filter.active {
    background: #035432;
    color: white;
}

/* ===================================================================
   CTA SECTION
   =================================================================== */

.cta-box {
    background: linear-gradient(135deg, #035432 0%, #023F25 100%);
    position: relative;
}

.cta-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.cta-title {
    font-size: 1.5rem;
}

.cta-subtitle {
    font-size: 0.9375rem;
}

.cta-feature {
    font-size: 0.875rem;
}

.cta-image {
    max-height: 250px;
}

/* ===================================================================
   ABOUT SECTION
   =================================================================== */

.about-image {
    max-height: 280px;
}

.about-features {
    font-size: 0.875rem;
}

.about-stats .stat-item {
    padding: 0 1rem;
    border-right: 1px solid #e5e7eb;
}

.about-stats .stat-item:last-child {
    border-right: none;
}

/* ===================================================================
   CONTACT SECTION
   =================================================================== */

.contact-card .icon-box {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.contact-form .form-control,
.contact-form .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

/* ===================================================================
   FOOTER SECTION
   =================================================================== */

.footer {
    background-color: var(--theme-bg-footer);
    color: rgba(255,255,255,0.75);
}

.footer-title {
    font-size: 0.9375rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: #FF9A00;
}

.footer-link {
    color: rgba(227,243,233,0.8);
    font-size: 0.8125rem;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #FF9A00;
    padding-left: 5px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,154,0,0.2);
    border-radius: 50%;
    color: #FF9A00;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #FF9A00;
    color: #023F25;
    transform: translateY(-3px);
}

.footer-bottom {
    border-color: rgba(255,255,255,0.1) !important;
}

/* Back to Top Button */
.btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(3,84,50,0.3);
}

.btn-back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================================
   BUTTON STYLES
   =================================================================== */

.btn {
    font-family: var(--theme-font-family);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-primary {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-outline-primary:hover {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-secondary {
    background-color: var(--theme-secondary);
    border-color: var(--theme-secondary);
}

.btn-secondary:hover {
    background-color: var(--theme-secondary-hover);
    border-color: var(--theme-secondary-hover);
}

.btn-light {
    background-color: white;
    border-color: white;
    color: var(--theme-primary);
}

.btn-light:hover {
    background-color: #f1f5f9;
    border-color: #f1f5f9;
    color: var(--theme-primary-hover);
}

/* ===================================================================
   CARD STYLES
   =================================================================== */

.card {
    background-color: var(--theme-bg-card);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

.text-primary { color: var(--theme-primary) !important; }
.text-secondary { color: var(--theme-secondary) !important; }
.text-success { color: var(--theme-success) !important; }
.text-warning { color: var(--theme-warning) !important; }
.text-danger { color: var(--theme-danger) !important; }
.text-info { color: var(--theme-info) !important; }

/* ===================================================================
   RESPONSIVE: TABLET (>= 576px)
   =================================================================== */

@media (min-width: 576px) {
    body {
        font-size: 15px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .btn-tab {
        padding: 0.75rem 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .icon-circle {
        width: 60px;
        height: 60px;
    }
    
    .icon-circle i {
        font-size: 1.5rem;
    }
    
    .type-name {
        font-size: 0.9375rem;
    }
    
    .property-price {
        font-size: 1.125rem;
    }
    
    .property-title a {
        font-size: 0.875rem;
    }
    
    .property-features {
        font-size: 0.75rem;
    }
}

/* ===================================================================
   RESPONSIVE: TABLET LANDSCAPE (>= 768px)
   =================================================================== */

@media (min-width: 768px) {
    body {
        font-size: 16px;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .hero-property {
        min-height: 550px;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-stats .stat-number {
        font-size: 2rem;
    }
    
    .hero-wave svg {
        height: 80px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .cta-title {
        font-size: 1.75rem;
    }
    
    .about-image {
        max-height: 350px;
    }
}

/* ===================================================================
   RESPONSIVE: DESKTOP (>= 992px)
   =================================================================== */

@media (min-width: 992px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem !important;
        border-bottom: none;
    }

    .navbar-nav .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--theme-primary);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .navbar-nav .nav-item {
        position: relative;
    }

    .navbar-nav .nav-link:hover::after,
    .navbar-nav .nav-link.active::after {
        width: 80%;
    }
    
    section {
        padding: 5rem 0;
    }
    
    .hero-property {
        min-height: 600px;
        padding-top: 2rem;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .search-box .card-body {
        padding: 1.5rem 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .icon-circle {
        width: 70px;
        height: 70px;
    }
    
    .icon-circle i {
        font-size: 1.75rem;
    }
    
    .property-card .card-body {
        padding: 1rem 1.25rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-image {
        max-height: 300px;
    }
    
    .about-image {
        max-height: 400px;
    }
}

/* ===================================================================
   RESPONSIVE: LARGE DESKTOP (>= 1200px)
   =================================================================== */

@media (min-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .hero-stats .stat-number {
        font-size: 2.5rem;
    }
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */

@media print {
    .navbar,
    .footer,
    .btn-back-to-top,
    .hero-property,
    .cta-section {
        display: none !important;
    }
}

/* ===================================================================
   เงื่อนไขราคา - ภาษีที่ดิน / หัก ณ ที่จ่าย / VAT (App\Helpers\PropertyPriceTerms)
   ป้ายและรายการ (components/property/price-terms) + บรรทัดสั้นบนการ์ดทรัพย์
   ไม่รวม = ข้อความปกติ/ไอคอนน้ำเงิน · ยังไม่กรอกยอด = ส้ม · รวมแล้ว = เขียว
   =================================================================== */

.pt-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}
.pt-term {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    /* ป้ายยาวขึ้น 2 บรรทัดบนมือถือ - แบ่งบรรทัดให้ยาวพอกัน (เบราว์เซอร์เก่าไม่รู้จักก็ตัดบรรทัดแบบเดิม) */
    text-wrap: balance;
}
.pt-term.is-extra {
    color: #334155;
    background: #f3f8fc;
    border-color: #dbeafe;
}
.pt-term.is-extra i { color: var(--theme-info, #3b82f6); }
.pt-term.is-pending {
    color: #8a4b00;
    background: #fffaf2;
    border-color: #f4d6a7;
}
.pt-term.is-included {
    color: #166534;
    background: #f3faf5;
    border-color: #cfe5d6;
}
.pt-price-disclosure {
    margin-top: 0.55rem;
    overflow: hidden;
    border: 1px solid var(--theme-border, #e5e7eb);
    border-radius: 12px;
    background: #fff;
}
.pt-price-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.8rem;
    cursor: pointer;
    list-style: none;
}
.pt-price-summary::-webkit-details-marker { display: none; }
.pt-price-summary::marker { content: ''; }
.pt-price-summary:focus-visible { outline: 2px solid var(--theme-primary, #035432); outline-offset: -2px; }
.pt-price-summary-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    color: var(--theme-primary, #035432);
    background: var(--theme-primary-light, #e3f3e9);
}
.pt-price-summary-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.3; }
.pt-price-summary-copy strong { color: var(--theme-text-heading, #035432); font-size: 0.875rem; font-weight: 700; }
.pt-price-summary-copy small { color: #64748b; font-size: 0.75rem; }
.pt-price-summary-arrow { flex: none; color: #64748b; font-size: 0.8rem; transition: transform 0.2s ease; }
.pt-price-disclosure[open] .pt-price-summary-arrow { transform: rotate(180deg); }
.pt-terms--list {
    display: block;
    margin: 0;
    padding: 0.3rem 0.8rem 0.55rem;
    border-top: 1px solid var(--theme-border, #e5e7eb);
}
.pt-terms--list .pt-term {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.55rem;
    padding: 0.5rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--theme-text-body, #1e293b);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    text-wrap: initial;
}
.pt-terms--list .pt-term + .pt-term {
    border-top: 1px solid var(--theme-border, #e5e7eb);
}
.pt-terms--list .pt-term i {
    justify-self: center;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--theme-info, #3b82f6);
}
.pt-terms--list .pt-term.is-pending i { color: #b45309; }
.pt-terms--list .pt-term.is-included i { color: var(--theme-primary, #035432); }
.pt-terms--list .pt-term-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.pt-terms--list .pt-term-copy strong { font-weight: 600; }
.pt-terms--list .pt-term-copy > span { color: #64748b; font-size: 0.8rem; }
.property-card-modern .pc-price-terms {
    min-height: 0.95rem;
    margin: -0.1rem 0 0.2rem;
    font-size: 0.68rem;
    line-height: 1.4;
    color: #64748b;
}
@media (max-width: 767.98px) {
    /* การ์ดแนวนอนบนมือถือย้ายราคาไปล่างสุด (order 4) - บรรทัดเงื่อนไขอยู่ใต้ราคา */
    .property-card-modern .pc-price-terms {
        order: 5;
        margin: 0.1rem 0 0;
    }
}

/* ===================================================================
   REDUCED MOTION
   Matches devices with animations turned off (Android "Remove animations" /
   animator duration scale off, iOS Reduce Motion, Windows "Adjust for best
   performance") - in practice mostly older phones and PCs.
   =================================================================== */

@media (prefers-reduced-motion: reduce) {
    /* Decorative motion plays once, instantly. Keep animation-iteration-count:
       without it an infinite animation keeps looping at 0.01ms per cycle
       (100,000 loops/sec), so spinners, skeletons and the home ticker flicker
       far too fast instead of stopping. */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    /* .toast-progress is the toast countdown ring (Web Animations since 2026-11-28,
       so this override no longer reaches it; the exception is kept harmless). */
    *:not(.toast-progress),
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }

    /* Loading indicators tell the user the page is still working - keep them
       turning, just calmer (Bootstrap 5 slows .spinner-border to 1.5s here too).
       Frozen on their first frame they look like a hung page. A new custom
       loader: use .spinner-border, or add .motion-essential to the element that
       carries the animation. The page-specific selectors are the home map,
       host dashboard, investor invoices and payment PDF/QR loaders. */
    .spinner-border,
    .spinner-grow,
    .hp-spinner,
    .hp-btn-loading::after,
    .swal2-loader,
    .hm-map-loading-spinner,
    .hd-invoice-btn.hd-invoice-btn-loading i,
    .hd-toast-icon.hd-toast-spin i,
    .iiv-row-dl.is-loading i,
    .inv-bd-pdf-btn.is-loading .bi-file-earmark-pdf-fill,
    [id^="qr-no-"] .bi-arrow-clockwise,
    .motion-essential {
        animation-duration: 1.5s !important;
        animation-iteration-count: infinite !important;
    }
}

/* ===================================================================
   GLOBAL FORM CONTROLS - Rounded inputs (matching admin style)
   Keeps original system colors; only overrides border-radius.
   =================================================================== */
.form-control,
.form-select,
textarea.form-control {
    border-radius: 10px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--theme-primary, #035432);
    box-shadow: 0 0 0 3px rgba(8, 99, 55, 0.12);
    outline: none;
}

/* Input groups: keep left/right radius only on edge children */
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-radius: 10px 10px 10px 10px !important;
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-radius: 0 0 0 0 !important;
}
.input-group > .input-group-text:first-child {
    border-radius: 10px 0 0 10px !important;
}
.input-group > .input-group-text:last-child {
    border-radius: 0 0 0 0 !important;
}
/* Only child in input-group stays fully rounded */
.input-group > .form-control:only-child {
    border-radius: 10px !important;
}

/* ===================================================================
   AREA-REQUEST CTA - "ไม่เจอที่ตรงใจ?" banner (prominent variant)
   Single row on both mobile and desktop so it stays compact instead of
   stacking icon/text/button into 3 rows on narrow screens.
   =================================================================== */
.area-cta-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #166534 0%, #035432 100%);
    color: #fff;
}
.area-cta-banner__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.area-cta-banner__text {
    flex: 1 1 auto;
    min-width: 0;
}
.area-cta-banner__text h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.3;
}
.area-cta-banner__text p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.85;
    line-height: 1.35;
}
.area-cta-banner__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #166534;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 999px;
    white-space: nowrap;
    border: none;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.area-cta-banner__btn:hover {
    color: #166534;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
@media (max-width: 575.98px) {
    .area-cta-banner {
        padding: 11px 14px;
        gap: 10px;
    }
    .area-cta-banner__icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    .area-cta-banner__text h3 {
        font-size: 0.84rem;
    }
    .area-cta-banner__text p {
        font-size: 0.72rem;
    }
    .area-cta-banner__btn span {
        display: none;
    }
    .area-cta-banner__btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}
/* ---- zoning-color.css ---- */
/* พื้นที่สี (2026-11-12): จุดสี · ชิป · แคปซูลบนการ์ดและหน้ารายละเอียดทรัพย์ (ไม่แสดงความหมายสีให้ลูกค้าแล้ว 2026-11-13)
   ใช้ร่วมกันทั้งหน้าเว็บ (layouts/property โหลดให้) และแอดมิน (@push styles ในหน้าที่แสดงสี)
   สีของแต่ละรายการมาจาก hr_zoning_colors.color_hex ผ่านตัวแปร --zc เท่านั้น - ไม่มีสีค้างในไฟล์นี้
   ชื่อสี/ความหมายเป็นข้อความเสมอ (ไม่ใช้สีอย่างเดียวบอกความหมาย) */

.zc-dot,
.zc-swatch {
    --zc: #94A3B8;
    flex: none;
    background: var(--zc);
}

.zc-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .22);
}

/* ชิปเล็ก: จุดสี + "พื้นที่สีม่วง" (การ์ดรายการ แอดมิน) */
.zc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 22px;
    padding: 3px 9px 0 8px;
    border-radius: 999px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #334155;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.zc-chip > .zc-dot {
    position: relative;
    top: -1px;
}

.zc-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* สี่เหลี่ยมสีในรายการจัดการพื้นที่สี (แอดมิน) */
.zc-swatch {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .2), inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* แคปซูลพื้นที่สีบนการ์ด (2026-11-13, รอบ 3): ต้อง "เบากว่า" ป้าย Verified เสมอ - Verified คือสิ่งที่ต้องเด่นที่สุดบนการ์ด (user: "ส่วน Verified สำคัญ มันต้องเด่น")
   และตัวหนังสือต้องอ่านชัด (user: "ตัวอักษรพื้นที่สีมองไม่ชัดเพราะกลืนกับสีมาก"). รอบ 2 ทำแคปซูลมันเงาเต็มสีเหมือน Verified ผิดทั้งสองข้อ:
   ความเด่นเท่ากัน และตัวหนังสือวางบนสีจริง (ม่วง/แดง/น้ำเงิน ตัดกับตัวเข้มแค่ ~4:1). ตอนนี้:
   - สีอยู่ที่จุดสี (ตัวบอกสี) + พื้นอ่อนจางมาก + ขอบบาง ไม่ใช่ทั้งแคปซูล; ตัวหนังสืออยู่บนพื้นเกือบขาว สีเข้ม ตัดกัน > 10:1 ทุกสี (ไม่ต้องเลือกตัวขาว/เข้มอีก)
   - แบนทั้งใบ: ไม่ไล่สีมันเงา ไม่มีเงา ไม่มีตราวงกลม · เตี้ยกว่าป้าย Verified (20px ต่อ 22px) · ตัวปกติ (ไม่หนา) ขนาด 12px ส่วนป้าย Verified ตัวหนาพิเศษบนทองมันเงา
   สีมาจาก hr_zoning_colors.color_hex ผ่าน --zc เท่านั้น; พื้น/ขอบผสมสีด้วย color-mix ใน @supports (ที่ไม่รู้จักใช้พื้นเทาอ่อน ขอบเทา - ยังอ่านครบ จุดสียังบอกสี) */
.pc-zone-slot {
    display: flex;
    flex: 0 1 auto;
    min-width: min-content; /* ไม่แคบกว่าชื่อสี (ตัดแค่คำว่า "พื้นที่" ก่อน) */
    max-width: 100%;
}

.pc-zone-pill {
    --zc: #94A3B8;
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    min-height: 20px;
    padding: 1px 10px 1px 7px;
    border: 1px solid #E2E8F0;
    border-radius: 999px;
    background: #F8FAFC;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

@supports (background: color-mix(in srgb, red 10%, white)) {
    .pc-zone-pill {
        border-color: color-mix(in srgb, var(--zc) 38%, #E2E8F0);
        background: color-mix(in srgb, var(--zc) 7%, #fff);
    }
}

/* จุดสี: ตัวบอกสีของพื้นที่ (วงขาวบางรอบ + ขอบเข้มโทนเดียวกับสี - สีขาว/สีอ่อนยังเห็นขอบ) อยู่กึ่งกลาง flex ของตัวมันเอง */
.pc-zone-seal {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    position: relative;
    top: .5px; /* ตัวไทยลอยเหนือกึ่งกลางบรรทัด: จุดอยู่กลางตัวพยัญชนะ ไม่ใช่กลางกล่อง (วัดพิกเซล: จุดสูงกว่า ~.6px ก่อนขยับ) */
}

.pc-zone-pill .zc-dot {
    width: 12px;
    height: 12px;
    background: var(--zc);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55), 0 0 0 1px rgba(15, 23, 42, .3);
}

@supports (background: color-mix(in srgb, red 10%, white)) {
    .pc-zone-pill .zc-dot {
        box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55), 0 0 0 1px color-mix(in srgb, var(--zc) 62%, #334155);
    }
}

.pc-zone-text {
    display: flex;
    flex-wrap: wrap-reverse;
    align-content: flex-end;
    row-gap: .8em; /* วรรณยุกต์ของบรรทัดที่ซ่อนอยู่ไม่โผล่ขึ้นมาในบรรทัดที่เห็น */
    min-width: min-content; /* ไม่แคบกว่าชื่อสี: ไม่มีการตัดกลางคำ/ขึ้น … */
    height: 1.5em; /* สูงพอให้ฟอนต์ที่วรรณยุกต์สูง (IBM Plex Sans Thai ในตัวอย่างหน้าแอดมิน) ไม่โดนตัดหัว */
    line-height: 1.5;
    overflow: hidden;
    white-space: nowrap;
}

/* หน้ารายละเอียดทรัพย์ (2026-11-13): วางต่อท้ายขนาดพื้นที่ในแถวข้อมูลสรุป (user: "แสดงข้างๆ ขนาดพื้นที่ ไม่ต้องแสดงความหมายสี")
   ตัวอักษรเท่าข้อมูลสรุปข้างเคียง (.9rem ≈ 14px) จุดสีโตตามให้สมดุล · ทุกขนาดอิงหน่วย em/px เดิมของแคปซูลบนการ์ด */
.pc-zone-pill--lg {
    gap: 7px;
    min-height: 26px;
    padding: 1.5px 12px 2.5px 9px; /* ตัวพยัญชนะไทยนั่งต่ำกว่ากลางกล่อง .4-.9px (วัดพิกเซล) - ขยับเนื้อหาขึ้น .5px ให้ตัวอักษรกับจุดสีอยู่กึ่งกลางแคปซูลจริง */
    font-size: 14px;
    font-weight: 600;
}

.pc-zone-pill--lg .pc-zone-seal,
.pc-zone-pill--lg .zc-dot {
    width: 14px;
    height: 14px;
}
/* ตำแหน่งบนการ์ด (2026-11-13: ย้ายมาแทนรีวิว): แถวราคา = ราคาซ้าย แคปซูลขวา
   เดสก์ท็อป: บรรทัดเดียว ราคาไม่หด (ตัวเลขสำคัญกว่า) แคปซูลเป็นฝ่ายรับที่เหลือ - ที่ไม่พอ คำว่า "พื้นที่" หายไปก่อน เหลือ "● สีเหลือง".
   มือถือ (การ์ดแนวนอน คอลัมน์เนื้อหาแค่ ~180px): แคปซูลขึ้นบรรทัดเหนือราคา เต็มความกว้างคอลัมน์ ("พื้นที่สีเหลือง" ครบ) -
   ป้าย Verified อยู่บรรทัดเดียวกับราคา ชิดขวา (property.css) ไม่ใช่บรรทัดแคปซูล
   (เดิมวางแคปซูลใต้ราคาข้างป้าย Verified: ที่ 360px ชื่อสีตั้งแต่ "สีเหลือง" ขึ้นไปทับป้าย) */
.property-card-modern.pc-has-zone .pc-row-price > div:first-child {
    flex-shrink: 0;
}

.property-card-modern.pc-has-zone .pc-zone-slot {
    margin-left: auto;
}

/* มือถือ (2026-11-13 รอบตัวหนังสือใหญ่): แถวราคาเป็นแถวที่ขึ้นบรรทัดได้ - แคปซูลกินเต็มบรรทัดบนสุด, บรรทัดล่าง = ราคา + ป้าย Verified
   (ป้ายอยู่ในแถวราคาจริงแล้ว ไม่ลอย ไม่ต้องเว้นขวา 92px ตายตัว - property.css "Verified") */
@media (max-width: 767.98px) {
    .property-card-modern.pc-has-zone .pc-row-price {
        flex-wrap: wrap;
        align-items: flex-end !important; /* Bootstrap .align-items-center บนแถวราคาเป็น !important */
        row-gap: 6px;
    }

    .property-card-modern.pc-has-zone .pc-zone-slot {
        order: -1;
        flex: 0 0 100%;
        margin-left: 0;
    }

    .property-card-modern.pc-has-zone .pc-row-price > div:first-child {
        flex-shrink: 1;
    }
}
/* ---- skeleton.css ---- */
/* ================================================
   Skeleton Loading System - Happy Realestate
   ================================================
   ระบบ shimmer กลาง ใช้ทุกที่ที่โหลดข้อมูลด้วย AJAX หลังหน้าโหลดเสร็จแล้ว
   (ไม่ใช่หน้า SSR ทั้งหน้า - เบราว์เซอร์โหลดหน้านั้นทีเดียวอยู่แล้ว)

   โหลดใน: layouts/property.blade.php และ layouts/frontend.blade.php (ทุกหน้า frontend)
   toggle ผ่าน: assets/js/skeleton-loader.js -> window.HappySkeleton.show(el)/.hide(el)

   ใช้งานอยู่ที่:
   - /search ผลลัพธ์กริด (.sk-card) + แผนที่ (.pm-skeleton)
   - หน้าแรก แผนที่ (.pm-skeleton)
   - property/detail รีวิว เมื่อเปลี่ยน sort/filter

   Primitives ทั่วไปสำหรับฟีเจอร์ใหม่ (ไม่ต้องเขียน CSS เฉพาะหน้าซ้ำ):
   .sk-line   - แถบข้อความบรรทัดเดียว (กำหนด width เอง)
   .sk-circle - วงกลม (รูปโปรไฟล์/ไอคอน, กำหนด width/height เอง)
   ================================================ */

@keyframes sk-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

/* Base shimmer box */
.sk-box {
    display: block;
    background: linear-gradient(90deg, #ececec 0%, #e0e0e0 40%, #ececec 80%);
    background-size: 800px 100%;
    animation: sk-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}

/* ── Skeleton card - mirrors .property-card-modern exactly ── */
.sk-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.07), 0 2px 12px rgba(0,0,0,.09);
    height: 100%;
}

/* Image placeholder: same 4:3 ratio as property image */
.sk-card__img  { aspect-ratio: 4/3; width: 100%; border-radius: 0; }
/* aspect-ratio ใช้ไม่ได้บน iOS < 15 / Chrome < 88 - กล่องรูปจะสูง 0px */
@supports not (aspect-ratio: 1 / 1) {
    @media (min-width: 768px) {
        .sk-card__img { height: 0; padding-top: 75%; }
    }
}

.sk-card__body { padding: .75rem; }

/* Price line: mirrors ฿15,000 font-size ~1.05rem */
.sk-card__price  { height: 1.3rem;  width: 55%; margin-bottom: .5rem;  }

/* Title: 2-line clamp at 0.875rem */
.sk-card__line1  { height: .85rem;  width: 90%; margin-bottom: .35rem; }
.sk-card__line2  { height: .85rem;  width: 70%; margin-bottom: .35rem; }

/* Property code: 0.68rem */
.sk-card__code   { height: .6rem;   width: 40%; margin-bottom: .5rem;  }

/* Location: 0.8rem */
.sk-card__loc    { height: .75rem;  width: 60%; margin-bottom: .5rem;  }

/* Feature row: bedrooms/bathrooms/area */
.sk-card__feat   { height: .65rem;  width: 50%; margin-top:   .5rem;   }

/* ── Generic primitives - compose new skeleton shapes without new CSS ── */
.sk-line {
    height: .85rem;
    border-radius: 4px;
    margin-bottom: .5rem;
}
.sk-line:last-child { margin-bottom: 0; }

.sk-circle {
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Map loading skeleton (home + search maps) ── */
.pm-skeleton {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}
.pm-skeleton.pm-skeleton-hidden {
    opacity: 0;
    pointer-events: none;
}
.pm-skeleton-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #4b5563;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.pm-skeleton-badge i {
    color: var(--theme-primary, #035432);
}

/* ── Section wrapper - hidden until .sk-show is added by JS ── */
.sk-section {
    display: none;
}
.sk-section.sk-show {
    display: block;
}

/* #searchSkeleton also carries Bootstrap's .row (display:flex) - without this override,
   the block rule above collapses it to a column stack (1 card/row) instead of wrapping. */
#searchSkeleton.sk-show {
    display: flex;
}

/* Old results were only dimmed (opacity .15) by JS while the skeleton shows, so the
   previous list stayed visible, faded, underneath/after it. Hide it outright instead. */
#searchSkeleton.sk-show ~ #gridView {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    .sk-section.sk-show {
        animation: sk-fadein .12s ease;
    }
    @keyframes sk-fadein {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* ── /search results skeleton: reveal row by row (4 cards/row) instead of all 8 popping in at once ── */
    #searchSkeleton.sk-show {
        animation: none;
    }
    #searchSkeleton.sk-show > div {
        opacity: 0;
        animation: sk-row-in .35s ease forwards;
    }
    #searchSkeleton.sk-show > div:nth-child(-n+4) { animation-delay: 0s;   }
    #searchSkeleton.sk-show > div:nth-child(n+5)  { animation-delay: .15s; }
    @keyframes sk-row-in {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ── Mobile: mirrors the horizontal property-card layout ── */
@media (max-width: 767.98px) {
    .sk-card {
        display: flex;
        flex-direction: row;
        height: auto;
        border-radius: 14px;
    }
    .sk-card__img {
        width: 136px;
        flex: 0 0 136px;
        aspect-ratio: unset;
        align-self: stretch;
        border-radius: 0;
    }
    .sk-card__body {
        flex: 1 1 auto;
        min-width: 0;
        padding: .75rem .85rem;
        border-left: 1px solid rgba(3,84,50,0.06);
    }
    .sk-card__code { display: none; }
}
/* ---- icon-label-align.css ---- */
/* Every Bootstrap icon is exactly 1em wide once its font has loaded (all 2,078 glyphs measured, 2026-11-06).
   Before that (slow network, first visit, hard reload) the invisible placeholder is ~.78em wide, so every
   icon and the words beside it jumped 4-11px sideways when the font arrived - the navbar "jerked" on reload.
   Reserving the 1em box changes nothing after load and removes the jump. :where() = no specificity. */
:where(.bi, [class^="bi-"], [class*=" bi-"])::before {
    width: 1em;
}

/* Icon next to a text label (buttons, chips, links, badges): see icon-label-align.js.
   The icon is centred on the line box, but Thai (and Latin) letters are drawn in the lower
   part of their line box (tone marks and upper vowels take the top), so the icon looked
   1-2px higher than the words in every button. Nudging the icon down by a font-relative
   amount puts its drawing level with the body of the text.
   `top` (not transform) so spin/pulse animations on the icon are untouched. */
.hi-label-icon {
    position: relative;
    top: .065em;
}

/* Measured (4x pixels, 2026-11-06): the magnifier's handle pulls its drawing up, and this bold 17.6px
   label sits lower than most - the hero search button needs a little more than the shared nudge. */
.btn-main-action > .hi-label-icon {
    top: .13em;
}
/* Same button below 576px: the label is hidden, the icon stands alone and measured 1px high in the box. */
.btn-main-action > .bi-search:not(.hi-label-icon) {
    position: relative;
    top: .06em;
}
/* ---- theme-system.css ---- */
/**
 * =======================================================================
 * THEME SYSTEM CSS - CSS Variables & Utility Classes
 * =======================================================================
 * 
 * ระบบ Theme ใช้ CSS Variables ภายใต้ Theme Class บน <body>
 * เปลี่ยน Theme ทั้งระบบได้โดยเปลี่ยน Class บน <body> เพียงจุดเดียว
 * 
 * Usage: <body class="theme-forest">
 * 
 * Available Themes:
 * - .theme-forest  (🌲 โทนเขียว - Default)
 * - .theme-ocean   (🌊 โทนน้ำเงิน)
 * - .theme-sunset  (🌅 โทนส้มทอง)
 * - .theme-luxury  (✨ โทนดำทอง)
 * =======================================================================
 */

/* =======================================================================
   THEME DEFINITIONS - CSS Variables สำหรับแต่ละ Theme
   ======================================================================= */

/* Default Theme (fallback) */
:root {
    /* Base colors */
    --theme-primary: #035432;
    --theme-primary-rgb: 3, 84, 50;
    --theme-primary-hover: #023F25;
    --theme-primary-light: #E3F3E9;
    --theme-secondary: #FF9A00;
    --theme-secondary-rgb: 255, 154, 0;
    --theme-secondary-hover: #E08800;
    --theme-accent: #FF9A00;

    /* Status colors */
    --theme-success: #10b981;
    --theme-success-light: #d1fae5;
    --theme-warning: #f59e0b;
    --theme-warning-light: #fef3c7;
    --theme-danger: #ef4444;
    --theme-danger-light: #fee2e2;
    --theme-info: #3b82f6;
    --theme-info-light: #dbeafe;

    /* Text colors - Theme Specific */
    --theme-text-heading: #035432;
    --theme-text-body: #1E293B;
    --theme-text-muted: #035432;
    --theme-text-light: #4C7A63;
    --theme-text-white: #ffffff;

    /* Background colors */
    --theme-bg-body: #F4F8F5;
    --theme-bg-light: #f8f9fa;
    --theme-bg-card: #ffffff;
    --theme-bg-header: #ffffff;
    --theme-bg-footer: #035432;

    /* Border colors */
    --theme-border: #e5e7eb;
    --theme-border-dark: #d1d5db;

    /* Gradients */
    --theme-gradient: linear-gradient(135deg, #035432 0%, #023F25 100%);
    --theme-gradient-subtle: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    --theme-gradient-gold: linear-gradient(135deg, #FFB84D 0%, #FF9A00 100%);

    /* Special */
    --theme-star: #FFB84D;
    --theme-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* =======================================================================
   🌲 THEME: FOREST (Default - โทนเขียวแบรนด์ Happy Realestate)
   ======================================================================= */
.theme-forest {
    --theme-primary: #035432;
    --theme-primary-rgb: 3, 84, 50;
    --theme-primary-hover: #023F25;
    --theme-primary-light: #E3F3E9;
    --theme-secondary: #FF9A00;
    --theme-secondary-rgb: 255, 154, 0;
    --theme-secondary-hover: #E08800;
    --theme-accent: #FF9A00;

    --theme-text-heading: #035432;
    --theme-text-body: #1E293B;
    --theme-text-muted: #035432;
    --theme-text-light: #4C7A63;

    --theme-bg-footer: #035432;

    --theme-gradient: linear-gradient(135deg, #035432 0%, #023F25 100%);
    --theme-gradient-subtle: linear-gradient(180deg, #ffffff 0%, #E3F3E9 100%);
}

/* =======================================================================
   🌊 THEME: OCEAN (โทนน้ำเงินมหาสมุทร)
   ======================================================================= */
.theme-ocean {
    --theme-primary: #3B82F6;
    --theme-primary-rgb: 59, 130, 246;
    --theme-primary-hover: #1D4ED8;
    --theme-primary-light: #DBEAFE;
    --theme-secondary: #60A5FA;
    --theme-secondary-rgb: 96, 165, 250;
    --theme-secondary-hover: #3B82F6;
    --theme-accent: #1E3A8A;

    --theme-text-heading: #1E3A8A;
    --theme-text-body: #1E40AF;
    --theme-text-muted: #3B82F6;
    --theme-text-light: #60A5FA;

    --theme-bg-footer: #1E3A8A;

    --theme-gradient: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    --theme-gradient-subtle: linear-gradient(180deg, #ffffff 0%, #DBEAFE 100%);
}

/* =======================================================================
   🌅 THEME: SUNSET (โทนส้มทอง)
   ======================================================================= */
.theme-sunset {
    --theme-primary: #F59E0B;
    --theme-primary-rgb: 245, 158, 11;
    --theme-primary-hover: #D97706;
    --theme-primary-light: #FEF3C7;
    --theme-secondary: #FBBF24;
    --theme-secondary-rgb: 251, 191, 36;
    --theme-secondary-hover: #F59E0B;
    --theme-accent: #92400E;

    --theme-text-heading: #92400E;
    --theme-text-body: #78350F;
    --theme-text-muted: #B45309;
    --theme-text-light: #D97706;

    --theme-bg-footer: #78350F;

    --theme-gradient: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --theme-gradient-subtle: linear-gradient(180deg, #ffffff 0%, #FEF3C7 100%);
}

/* =======================================================================
   ✨ THEME: LUXURY (โทนดำทองหรูหรา)
   ======================================================================= */
.theme-luxury {
    --theme-primary: #D4AF37;
    --theme-primary-rgb: 212, 175, 55;
    --theme-primary-hover: #B8860B;
    --theme-primary-light: #FDF6E3;
    --theme-secondary: #1A1A1A;
    --theme-secondary-rgb: 26, 26, 26;
    --theme-secondary-hover: #333333;
    --theme-accent: #8B7355;

    --theme-text-heading: #1A1A1A;
    --theme-text-body: #333333;
    --theme-text-muted: #8B7355;
    --theme-text-light: #A89F91;

    --theme-bg-footer: #1A1A1A;

    --theme-gradient: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    --theme-gradient-subtle: linear-gradient(180deg, #ffffff 0%, #FDF6E3 100%);
}

/* =======================================================================
   NEUTRAL / UTILITY CLASSES (FOR VISUAL BALANCE)
   Use these for standard text, readability, and structure.
   Do not use theme colors for body text or labels to avoid visual clutter.
   ======================================================================= */
.text-neutral-900 {
    color: #111827 !important;
}

.text-neutral-800 {
    color: #1f2937 !important;
}

.text-neutral-700 {
    color: #374151 !important;
}

.text-neutral-600 {
    color: #4b5563 !important;
}

.text-neutral-500 {
    color: #6b7280 !important;
}

.text-neutral-400 {
    color: #9ca3af !important;
}

.bg-neutral-50 {
    background-color: #f9fafb !important;
}

.bg-neutral-100 {
    background-color: #f3f4f6 !important;
}

.bg-neutral-200 {
    background-color: #e5e7eb !important;
}

.bg-neutral-900 {
    background-color: #111827 !important;
}

.border-neutral-100 {
    border-color: #f3f4f6 !important;
}

.border-neutral-200 {
    border-color: #e5e7eb !important;
}

.border-neutral-300 {
    border-color: #d1d5db !important;
}

.border-neutral-400 {
    border-color: #9ca3af !important;
}

/* =======================================================================
   TEXT COLOR UTILITIES (THEME)
   Use these ONLY for emphasis, branding, or specific highlights.
   ======================================================================= */
.text-theme-primary {
    color: var(--theme-primary) !important;
}

.text-theme-primary-hover {
    color: var(--theme-primary-hover) !important;
}

.text-theme-secondary {
    color: var(--theme-secondary) !important;
}

.text-theme-accent {
    color: var(--theme-accent) !important;
}

.text-theme-heading {
    color: var(--theme-text-heading) !important;
}

.text-theme-body {
    color: var(--theme-text-body) !important;
}

.text-theme-muted {
    color: var(--theme-text-muted) !important;
}

.text-theme-light {
    color: var(--theme-text-light) !important;
}

.text-theme-white {
    color: var(--theme-text-white) !important;
}

.text-theme-success {
    color: var(--theme-success) !important;
}

.text-theme-warning {
    color: var(--theme-warning) !important;
}

.text-theme-danger {
    color: var(--theme-danger) !important;
}

.text-theme-info {
    color: var(--theme-info) !important;
}

/* =======================================================================
   BACKGROUND COLOR UTILITIES
   ======================================================================= */
.bg-theme-primary {
    background-color: var(--theme-primary) !important;
}

.bg-theme-primary-hover {
    background-color: var(--theme-primary-hover) !important;
}

.bg-theme-primary-light {
    background-color: var(--theme-primary-light) !important;
}

.bg-theme-secondary {
    background-color: var(--theme-secondary) !important;
}

.bg-theme-accent {
    background-color: var(--theme-accent) !important;
}

.bg-theme-body {
    background-color: var(--theme-bg-body) !important;
}

.bg-theme-light {
    background-color: var(--theme-bg-light) !important;
}

.bg-theme-card {
    background-color: var(--theme-bg-card) !important;
}

.bg-theme-header {
    background-color: var(--theme-bg-header) !important;
}

.bg-theme-footer {
    background-color: var(--theme-bg-footer) !important;
}

/* Transparent Backgrounds */
.bg-theme-primary-alpha-10 {
    background-color: rgba(var(--theme-primary-rgb), 0.1) !important;
}

.bg-theme-primary-alpha-20 {
    background-color: rgba(var(--theme-primary-rgb), 0.2) !important;
}

.bg-theme-secondary-alpha-10 {
    background-color: rgba(var(--theme-secondary-rgb), 0.1) !important;
}

.bg-theme-secondary-alpha-20 {
    background-color: rgba(var(--theme-secondary-rgb), 0.2) !important;
}

/* =======================================================================
   GRADIENT UTILITIES
   ======================================================================= */
.bg-theme-gradient {
    background: var(--theme-gradient) !important;
}

.bg-theme-gradient-subtle {
    background: var(--theme-gradient-subtle) !important;
}

.bg-theme-gradient-gold {
    background: var(--theme-gradient-gold) !important;
}

/* =======================================================================
   BORDER COLOR UTILITIES
   ======================================================================= */
.border-theme-primary {
    border-color: var(--theme-primary) !important;
}

.border-theme-secondary {
    border-color: var(--theme-secondary) !important;
}

.border-theme-accent {
    border-color: var(--theme-accent) !important;
}

.border-theme-light {
    border-color: var(--theme-border) !important;
}

.border-theme-dark {
    border-color: var(--theme-border-dark) !important;
}

/* =======================================================================
   BADGE UTILITIES
   ======================================================================= */
.badge-theme-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-white) !important;
}

.badge-theme-primary-light {
    background-color: var(--theme-primary-light) !important;
    color: var(--theme-primary-hover) !important;
}

.badge-theme-sell {
    background-color: var(--theme-danger) !important;
    color: var(--theme-text-white) !important;
}

.badge-theme-rent {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-white) !important;
}

.badge-theme-featured {
    background: var(--theme-gradient-gold) !important;
    color: #000000 !important;
    font-weight: 700;
}

/* =======================================================================
   BUTTON UTILITIES
   ======================================================================= */
.btn-theme-primary {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-text-white) !important;
}

.btn-theme-primary:hover,
.btn-theme-primary:focus {
    background-color: var(--theme-primary-hover) !important;
    border-color: var(--theme-primary-hover) !important;
}

.btn-theme-secondary {
    background-color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
    color: var(--theme-text-white) !important;
}

.btn-theme-secondary:hover,
.btn-theme-secondary:focus {
    background-color: var(--theme-secondary-hover) !important;
    border-color: var(--theme-secondary-hover) !important;
}

.btn-theme-outline {
    background-color: transparent !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-primary) !important;
}

.btn-theme-outline:hover,
.btn-theme-outline:focus {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-white) !important;
}

.btn-theme-gradient {
    background: var(--theme-gradient) !important;
    border: none !important;
    color: var(--theme-text-white) !important;
}

.btn-theme-gradient:hover {
    filter: brightness(1.1);
}

/* =======================================================================
   ICON UTILITIES
   ======================================================================= */
.icon-theme-primary {
    color: var(--theme-primary) !important;
}

.icon-theme-secondary {
    color: var(--theme-secondary) !important;
}

.icon-theme-accent {
    color: var(--theme-accent) !important;
}

.icon-theme-muted {
    color: var(--theme-text-muted) !important;
}

.icon-theme-light {
    color: var(--theme-text-light) !important;
}

.icon-theme-star {
    color: var(--theme-star) !important;
}

.icon-theme-white {
    color: var(--theme-text-white) !important;
}

/* =======================================================================
   SECTION UTILITIES
   ======================================================================= */
.section-theme-primary {
    background-color: var(--theme-primary);
    color: var(--theme-text-white);
}

.section-theme-light {
    background-color: var(--theme-bg-light);
}

.section-theme-gradient {
    background: var(--theme-gradient);
    color: var(--theme-text-white);
}

/* =======================================================================
   CARD UTILITIES
   ======================================================================= */
.card-theme {
    background-color: var(--theme-bg-card);
    border-color: var(--theme-border);
}

.card-theme-hover:hover {
    border-color: var(--theme-primary);
}

/* =======================================================================
   LINK UTILITIES
   ======================================================================= */
.link-theme-primary {
    color: var(--theme-primary) !important;
}

.link-theme-primary:hover {
    color: var(--theme-primary-hover) !important;
}

/* =======================================================================
   MODAL HEADER THEME
   ======================================================================= */
.modal-header-theme {
    background: var(--theme-gradient);
    color: var(--theme-text-white);
}

.modal-header-theme .btn-close {
    filter: invert(1);
}

/* =======================================================================
   FORM THEME
   ======================================================================= */
.form-control:focus,
.form-select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.25);
}

/* =======================================================================
   STEP PROGRESS UTILITIES
   ======================================================================= */
.step-theme-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #f3f4f6;
    border: 3px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #6b7280;
    transition: all 0.3s ease;
}

.step-theme-active .step-theme-circle {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: var(--theme-text-white);
}

.step-theme-completed .step-theme-circle {
    background-color: var(--theme-success);
    border-color: var(--theme-success);
    color: var(--theme-text-white);
}

.step-theme-label {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.step-theme-active .step-theme-label {
    color: var(--theme-primary);
    font-weight: 600;
}

.step-theme-line {
    flex: 1;
    height: 3px;
    background-color: #e5e7eb;
    margin: 0 8px;
    align-self: center;
}

.step-theme-completed+.step-theme-line {
    background-color: var(--theme-success);
}

/* =======================================================================
   UPLOAD ZONE UTILITIES
   ======================================================================= */
.upload-zone-theme {
    border: 2px dashed #9ca3af;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone-theme:hover,
.upload-zone-theme.drag-over {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), 0.05);
    /* Use primary with low opacity */
}

/* =======================================================================
   SHADOW UTILITIES
   ======================================================================= */
.shadow-theme {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* =======================================================================
   BOOTSTRAP "PRIMARY" OVERRIDE
   The vendored bootstrap.min.css hardcodes #0d6efd (Bootstrap blue) directly
   into every .primary utility/component rule instead of referencing a CSS
   variable, so plain Bootstrap classes (btn-primary, bg-primary, page-link,
   nav-pills, form-check, etc.) never picked up the brand theme. This section
   re-points them all to --theme-primary so the whole client site is consistent
   regardless of whether a page used the theme-* utility classes or plain
   Bootstrap ones.
   ======================================================================= */
.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled {
    color: #fff;
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}
.btn-primary:hover {
    color: #fff;
    background-color: var(--theme-primary-hover);
    border-color: var(--theme-primary-hover);
}
.btn-primary:focus,
.btn-check:focus + .btn-primary {
    color: #fff;
    background-color: var(--theme-primary-hover);
    border-color: var(--theme-primary-hover);
    box-shadow: 0 0 0 .25rem rgba(var(--theme-primary-rgb), .5);
}
.btn-primary,
.btn-check:checked + .btn-primary,
.btn-primary.active,
.btn-primary:active,
.show > .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--theme-primary-hover);
    border-color: var(--theme-primary-hover);
}
.btn-primary:active:focus,
.btn-primary.active:focus,
.btn-check:checked + .btn-primary:focus,
.show > .btn-primary.dropdown-toggle:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--theme-primary-rgb), .5);
}

.btn-outline-primary {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}
.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary,
.btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show,
.btn-outline-primary:active {
    color: #fff;
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}
.btn-outline-primary:focus,
.btn-outline-primary:hover:focus,
.btn-check:checked + .btn-outline-primary:focus,
.btn-outline-primary.active:focus,
.btn-outline-primary.dropdown-toggle.show:focus,
.btn-outline-primary:active:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--theme-primary-rgb), .5);
}
.btn-outline-primary.disabled,
.btn-outline-primary:disabled {
    color: var(--theme-primary);
    background-color: transparent;
}

.text-primary { color: var(--theme-primary) !important; }
.bg-primary { background-color: var(--theme-primary) !important; }
.border-primary { border-color: var(--theme-primary) !important; }
.link-primary { color: var(--theme-primary) !important; }

.form-check-input:checked {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}
.form-check-input:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 .25rem rgba(var(--theme-primary-rgb), .25);
}

.page-link { color: var(--theme-primary); }
.page-item.active .page-link {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--theme-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--theme-primary);
    color: #fff !important;
}

.progress-bar { background-color: var(--theme-primary); }

.alert-primary {
    color: var(--theme-primary-hover);
    background-color: var(--theme-primary-light);
    border-color: var(--theme-primary-light);
}
.list-group-item-primary {
    color: var(--theme-primary-hover);
    background-color: var(--theme-primary-light);
}
/* ---- happy-form-controls.css ---- */
:root {
    --hf-surface: #ffffff;
    --hf-surface-muted: #f8fafc;
    --hf-border: var(--theme-border-color, var(--border, #d6dce5));
    --hf-text: var(--theme-text-body, var(--text, #1f2937));
    --hf-text-muted: var(--theme-text-muted, var(--text-muted, #64748b));
    --hf-heading: var(--theme-text-heading, var(--text, #0f172a));
    --hf-primary: var(--theme-primary, var(--primary, #035432));
    --hf-primary-hover: var(--theme-primary-hover, var(--primary-hover, #023F25));
    --hf-danger: var(--theme-danger, var(--admin-danger, #dc2626));
    --hf-radius: 12px;
    --hf-radius-lg: 16px;
    --hf-shadow: 0 18px 38px rgba(15, 23, 42, 0.12), 0 6px 14px rgba(15, 23, 42, 0.08);
    --hf-focus-ring: 0 0 0 4px rgba(3, 84, 50, 0.14);
    --hf-font-size: 0.95rem;
    --hf-font-size-sm: 0.875rem;
    --hf-font-size-xs: 0.75rem;
}

.hf-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.hf-field__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hf-heading);
}

.hf-field__helper {
    font-size: var(--hf-font-size-xs);
    color: var(--hf-text-muted);
}

.hf-field__error {
    font-size: var(--hf-font-size-xs);
    color: var(--hf-danger);
}

.hf-select,
.hf-picker {
    position: relative;
    /* width: 100%; */
}

.hf-select__native {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

.hf-select__button,
input[data-hf-picker] {
    height: calc(1.5em + 0.75rem + 2px);
    min-height: 0;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius);
    background: var(--hf-surface);
    color: var(--hf-text);
    font-size: var(--hf-font-size);
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease,
        color 0.18s ease, transform 0.18s ease;
}

.hf-select__button {
    -webkit-appearance: none; appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
    cursor: pointer;
}

.hf-select__button.form-select {
    background-image: none !important;
    /* Bootstrap's .form-select.is-invalid/.is-valid rules (higher specificity via :not([multiple]):not([size]))
       reserve padding-right: 4.125rem for their own two-icon background image. We already kill that image
       above, but without !important here their padding-right still wins and leaves a big empty gap before
       the chevron - so the arrow floats away from the right edge whenever the select carries is-invalid/is-valid. */
    padding-right: 0.75rem !important;
}

.hf-select__button:hover,
input[data-hf-picker]:hover {
    border-color: var(--hf-primary);
    background: #fcfefe;
}

.hf-select__button:focus,
input[data-hf-picker]:focus {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: var(--hf-focus-ring);
}
.hf-select__button:focus-visible,
input[data-hf-picker]:focus-visible {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: var(--hf-focus-ring);
}

.hf-select__button:disabled,
input[data-hf-picker]:disabled {
    cursor: not-allowed;
    background: #f1f5f9;
    color: #94a3b8;
}

.hf-select__value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hf-select__value.is-placeholder {
    color: var(--hf-text-muted);
}

.hf-select__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.hf-select__clear,
.hf-panel__nav,
.hf-panel__footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--hf-text-muted);
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.hf-select__clear {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
}

.hf-select__clear:hover,
.hf-panel__nav:hover,
.hf-panel__footer-btn:hover {
    background: rgba(3, 84, 50, 0.08);
    color: var(--hf-primary);
}

.hf-select__chevron {
    font-size: 0.78rem;
    color: var(--hf-text-muted);
}

.hf-select__button.is-open .hf-select__chevron {
    transform: rotate(180deg);
}

.hf-floating-panel {
    position: fixed;
    z-index: 10600; /* must stay above .hp-overlay (10500-10502 for stacked HappyPopup dialogs) so date/select pickers work inside a popup */
    display: none;
    min-width: 280px;
    max-width: min(360px, calc(100vw - 24px));
    padding: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: var(--hf-radius-lg);
    background: var(--hf-surface);
    box-shadow: var(--hf-shadow);
}

.hf-floating-panel.is-open {
    display: block;
}

.hf-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.hf-panel__header--compound {
    align-items: stretch;
}

.hf-panel__title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--hf-heading);
}

.hf-panel__header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.hf-panel__header-select {
    flex: 1;
    min-width: 0;
    height: 2.15rem;
    padding: 0.2rem 1.9rem 0.2rem 0.75rem;
    border: 1.5px solid rgba(3, 84, 50, 0.22);
    border-radius: 999px;
    background-color: rgba(3, 84, 50, 0.07);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    color: var(--hf-primary);
    font-size: 0.84rem;
    font-weight: 700;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-sizing: border-box;
}

.hf-panel__header-select:hover {
    border-color: rgba(3, 84, 50, 0.4);
    background-color: rgba(3, 84, 50, 0.13);
}

.hf-panel__header-select:focus {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: var(--hf-focus-ring);
    background-color: rgba(3, 84, 50, 0.1);
}

.hf-panel__header-select--year {
    flex: 0 0 5.6rem;
}

.hf-panel__nav {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.hf-panel__search {
    width: 100%;
    min-height: 40px;
    margin-bottom: 0.8rem;
    padding: 0.68rem 0.82rem;
    border: 1px solid var(--hf-border);
    border-radius: 10px;
    background: var(--hf-surface-muted);
    font-size: var(--hf-font-size-sm);
    color: var(--hf-text);
}

.hf-panel__search:focus {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: var(--hf-focus-ring);
    background: var(--hf-surface);
}

.hf-select__options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 256px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.hf-select__option {
    width: 100%;
    padding: 0.72rem 0.82rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--hf-text);
    font-size: var(--hf-font-size-sm);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.hf-select__option:hover,
.hf-select__option.is-active {
    background: rgba(3, 84, 50, 0.08);
    border-color: rgba(3, 84, 50, 0.16);
    color: var(--hf-primary);
}

.hf-select__option.is-selected {
    background: rgba(3, 84, 50, 0.12);
    border-color: rgba(3, 84, 50, 0.2);
    color: var(--hf-primary);
    font-weight: 600;
}

.hf-select__empty {
    padding: 0.9rem 0.75rem;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--hf-text-muted);
    font-size: var(--hf-font-size-sm);
    text-align: center;
}

.hf-picker__weekdays,
.hf-picker__days,
.hf-picker__months,
.hf-picker__years {
    display: grid;
    gap: 0.35rem;
}

.hf-picker__weekdays,
.hf-picker__days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.hf-picker__months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.hf-picker__months .hf-picker__cell {
    min-height: 3.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 12px;
    flex-direction: column;
    gap: 0.2rem;
}

.hf-picker__years {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.hf-picker__years .hf-picker__cell {
    min-height: 2.7rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 12px;
}

.hf-picker__weekday {
    padding-bottom: 0.1rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--hf-text-muted);
}

.hf-picker__cell {
    min-height: 2.5rem;
    padding: 0.35rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--hf-text);
    font-size: var(--hf-font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.hf-picker__cell:hover,
.hf-picker__cell.is-active {
    background: rgba(3, 84, 50, 0.08);
    border-color: rgba(3, 84, 50, 0.18);
    color: var(--hf-primary);
}

.hf-picker__cell.is-selected {
    background: var(--hf-primary);
    border-color: var(--hf-primary);
    color: #ffffff;
    font-weight: 700;
}

.hf-picker__cell.is-muted {
    color: #94a3b8;
}

.hf-picker__cell.is-disabled {
    background: transparent;
    border-color: transparent;
    color: #cbd5e1;
    cursor: not-allowed;
}

.hf-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.8rem;
    border-top: 1px solid #eef2f7;
}

.hf-panel__footer-btn {
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
}

.hf-panel__footer-btn.hf-panel__footer-btn--primary {
    background: rgba(3, 84, 50, 0.1);
    color: var(--hf-primary);
}

.hf-panel__footer-btn.hf-panel__footer-btn--primary:hover {
    background: rgba(3, 84, 50, 0.16);
}

.hf-select__button.is-invalid,
input[data-hf-picker].is-invalid,
.hf-field--invalid .hf-select__button,
.hf-field--invalid input[data-hf-picker] {
    border-color: var(--hf-danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.hf-select__button.form-select-sm,
.hf-select__button.form-control-sm,
input[data-hf-picker].form-select-sm,
input[data-hf-picker].form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.84rem;
}

.hf-select__button.form-select-lg,
.hf-select__button.form-control-lg,
input[data-hf-picker].form-select-lg,
input[data-hf-picker].form-control-lg {
    height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 1rem;
    font-size: 1.05rem;
}

.hf-select__button.text-center,
input[data-hf-picker].text-center {
    text-align: center;
}

/* dd/mm/yyyy (ค.ศ.) masked date field - see enhanceDmyDate() in happy-form-controls.js */
.hf-dmy-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hf-dmy-input {
    flex: 1;
    min-width: 0;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius);
    background: var(--hf-surface);
    color: var(--hf-text);
    font-size: var(--hf-font-size);
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.hf-dmy-input:hover {
    border-color: var(--hf-primary);
}

.hf-dmy-input:focus {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: var(--hf-focus-ring);
}

.hf-dmy-input.is-invalid {
    border-color: var(--hf-danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.hf-dmy-picker-wrap {
    position: relative;
    width: calc(1.5em + 0.75rem + 2px);
    height: calc(1.5em + 0.75rem + 2px);
    flex-shrink: 0;
}

.hf-dmy-picker-wrap .hf-dmy-picker {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius);
    background: var(--hf-surface);
    color: transparent;
    caret-color: transparent;
    cursor: pointer;
}

.hf-dmy-picker-wrap .hf-dmy-picker::placeholder {
    color: transparent;
}

.hf-dmy-picker-wrap .hf-dmy-picker:hover {
    border-color: var(--hf-primary);
}

.hf-dmy-picker-wrap .hf-dmy-picker:focus {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: var(--hf-focus-ring);
}

.hf-dmy-picker-wrap .bi-calendar3 {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--hf-primary);
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .hf-floating-panel {
        max-width: calc(100vw - 16px);
        padding: 0.8rem;
        border-radius: 14px;
    }

    .hf-picker__months {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hf-picker__years {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* iOS/Android zoom fix - Safari zooms when focused input font-size < 16px */
@media screen and (max-width: 1024px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="time"],
    input[type="month"],
    input[type="week"],
    input[type="url"],
    select,
    textarea,
    .form-control,
    .form-select,
    .hf-select__button,
    input[data-hf-picker] {
        font-size: 16px !important;
    }
}
/* ---- toast-notifications.css ---- */
/* ============================================================
   HappyToast - การแจ้งเตือนมุมขวาบน (toast-notifications.js)
   ลายเซ็น "ตราประทับ": ไอคอนในวงกลมสีทึบที่กดประทับลงตอนแสดง + วงนับเวลารอบวง
   สี/เงา/ระยะทั้งหมดเป็น tokens บน .ht-region - Light ตั้งต้น, Dark เมื่อ
   <html data-theme="dark"> หรือ HappyToast.config({ theme: 'dark' })
   ไม่มีแถบสีขอบซ้าย (กฎโปรเจกต์) ไม่มียกตัวตอน hover
   ============================================================ */

.ht-region {
    --ht-surface: #ffffff;
    --ht-border: rgba(15, 23, 42, 0.09);
    --ht-text: #0f172a;          /* 17:1 บนพื้นขาว */
    --ht-text-2: #334155;        /* 10:1 */
    --ht-muted: #64748b;         /* 4.7:1 - ไอคอนปุ่มปิด */
    --ht-hover: rgba(15, 23, 42, 0.06);
    --ht-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 24px -8px rgba(15, 23, 42, 0.22), 0 22px 44px -18px rgba(3, 84, 50, 0.22);
    --ht-radius: 14px;
    --ht-width: 360px;
    --ht-brand: #035432;         /* เขียวมีสุข (config theme.colors.primary) */
    --ht-brand-soft: #e7f1ec;
    --ht-on-type: #ffffff;       /* ไอคอนบนวงสี - ทุกสีด้านล่าง >= 4.8:1 กับขาว */
    --ht-success: #0f7a43;
    --ht-error: #d92d20;
    --ht-warning: #b45309;
    --ht-info: #2563eb;
    --ht-loading: #035432;
    --ht-track: rgba(15, 23, 42, 0.16);
    --ht-focus: #2563eb;
    --ht-fold: #eef3f0;          /* ใบที่พับ: เข้มขึ้นทีละชั้น ให้เห็นเป็นกอง */
    --ht-fold-2: #e2e9e5;
    --ht-chip: rgba(15, 23, 42, 0.08);
    --ht-ease-move: cubic-bezier(0.22, 0.8, 0.24, 1);
    --ht-ease-spring: cubic-bezier(0.18, 1.3, 0.4, 1);
    --ht-ease-out: cubic-bezier(0.4, 0, 1, 1);

    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    width: var(--ht-width);
    max-width: calc(100vw - 32px);
    height: 0;
    pointer-events: none;
    /* ไม่ตั้งฟอนต์เอง = ใช้ฟอนต์ของหน้า (แอดมิน IBM Plex Sans Thai); --ht-font ถ้าอยากเปลี่ยน */
    font-family: var(--ht-font);
    -webkit-font-smoothing: antialiased;
}

.ht-region[data-ht-theme="dark"],
:root[data-theme="dark"] .ht-region {
    --ht-surface: #17211c;
    --ht-border: rgba(255, 255, 255, 0.1);
    --ht-text: #f1f5f3;
    --ht-text-2: #c9d4ce;
    --ht-muted: #9aa8a1;
    --ht-hover: rgba(255, 255, 255, 0.08);
    --ht-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -10px rgba(0, 0, 0, 0.6);
    --ht-brand: #6ee7a8;
    --ht-brand-soft: rgba(110, 231, 168, 0.14);
    --ht-on-type: #0b1410;       /* โหมดมืด: วงสีอ่อน ไอคอนเข้ม */
    --ht-success: #4ade80;
    --ht-error: #f87171;
    --ht-warning: #fbbf24;
    --ht-info: #60a5fa;
    --ht-loading: #6ee7a8;
    --ht-track: rgba(255, 255, 255, 0.2);
    --ht-focus: #93c5fd;
    --ht-fold: #1e2a24;
    --ht-fold-2: #25332c;
    --ht-chip: rgba(255, 255, 255, 0.12);
}

/* ผู้ใช้ขอความต่างสีมากขึ้น (Windows/macOS "Increase contrast") */
@media (prefers-contrast: more) {
    .ht-region {
        --ht-border: rgba(15, 23, 42, 0.45);
        --ht-text-2: #0f172a;
        --ht-muted: #334155;
        --ht-track: rgba(15, 23, 42, 0.4);
    }
}

.ht-region.is-hit { pointer-events: auto; }
.ht-region[data-position$="left"] { right: auto; left: 16px; }
.ht-region[data-position$="center"] { right: auto; left: 50%; margin-left: calc(var(--ht-width) / -2); }
.ht-region[data-position^="bottom"] { top: auto; bottom: 16px; }

/* ---------- การ์ด ---------- */
.toast-notification {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 8px 12px 12px;
    background: var(--ht-surface);
    color: var(--ht-text);
    border: 1px solid var(--ht-border);
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow);
    text-align: left;
    pointer-events: auto;
    /* ใบที่พับย่อเข้าหาขอบบน (โผล่เหนือใบแรก) */
    transform-origin: 50% 0;
    touch-action: pan-y;
    will-change: transform;
    /* ตำแหน่ง = สปริงผ่าน Web Animations (toast-notifications.js) - CSS ดูแลแค่การจางเข้า/ออก */
    transition: opacity 180ms ease, background-color 200ms ease;
}

.ht-region[data-position^="bottom"] .toast-notification { top: auto; bottom: 0; transform-origin: 50% 100%; }
/* เบราว์เซอร์ที่ไม่มี Web Animations: เลื่อนด้วย CSS แทน */
.ht-region.ht-css-motion .toast-notification { transition: transform 320ms var(--ht-ease-move), opacity 180ms ease; }
.ht-region.ht-css-motion .toast-notification.is-dragging { transition: none; }

.toast-notification > * { transition: opacity 140ms ease; }
.toast-notification.is-entering { opacity: 0; transition: none; }
.toast-notification.toast-exiting {
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms var(--ht-ease-out);
}
/* ใบที่พับซ้อนอยู่หลังใบแรก: เห็นแค่ขอบ สีเข้มขึ้นทีละชั้น */
.toast-notification.is-folded { overflow: hidden; pointer-events: none; background: var(--ht-fold); box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.18); }
.toast-notification.is-folded-2 { background: var(--ht-fold-2); }
.toast-notification.is-folded > * { opacity: 0; }
.toast-notification.is-buried { opacity: 0; }

/* ---------- ตราประทับ ---------- */
.toast-success { --ht-type: var(--ht-success); }
.toast-error { --ht-type: var(--ht-error); }
.toast-warning { --ht-type: var(--ht-warning); }
.toast-info { --ht-type: var(--ht-info); }
.toast-loading { --ht-type: var(--ht-loading); }

.toast-stamp {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
}

.toast-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    overflow: visible;
    transform: rotate(-90deg);
}

.toast-ring circle { fill: none; stroke-width: 2.5; }
/* ขอบตราเป็นจุดแบบตรายาง (24 จุด) - วงนับเวลาทึบวิ่งทับ */
.toast-ring-track { stroke: var(--ht-track); stroke-dasharray: 2 2.7125; stroke-linecap: round; }
.toast-progress {
    stroke: var(--ht-type);
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 0;
}
.toast-notification.no-ring .toast-ring { display: none; }

.toast-icon {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ht-type);
    color: var(--ht-on-type);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ไอคอนกลางวงกลม: strut ของฟอนต์ไอคอนเอง + px คู่ (frontend-ui.md "Icons and letters centred in a circle") */
.toast-icon .bi { font-family: bootstrap-icons; font-size: 18px; line-height: 1; }
.toast-icon .bi::before { vertical-align: 0; }
.toast-warning .toast-icon .bi { font-size: 14px; }
/* glyph บางตัววาดเยื้องในกล่อง em ของมันเอง (วัดพิกเซลที่ 3x/4x) - ขยับเฉพาะตัวนั้น */
.toast-success .toast-icon .bi { position: relative; left: -0.025em; }

/* error "!" วาดเองด้วยพิกเซลเต็ม (4 x 16 ในวง 30 = เหลือขอบ 13/7 พอดี) - กึ่งกลางทุกความละเอียดจอ
   glyph bi-exclamation-lg ของฟอนต์วาดสูง 0.67px และเลื่อนด้วย CSS ได้ผลไม่เท่ากันในจอ 1x/2x/3x */
.toast-icon .ht-excl { position: relative; display: block; width: 4px; height: 16px; }
.toast-icon .ht-excl::before,
.toast-icon .ht-excl::after {
    content: '';
    position: absolute;
    left: 0;
    width: 4px;
    background: currentColor;
}
.toast-icon .ht-excl::before { top: 0; height: 10px; border-radius: 2px; }
.toast-icon .ht-excl::after { bottom: 0; height: 4px; border-radius: 50%; }

/* หมึกซึมรอบตราตอนประทับ */
.toast-stamp::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ht-type) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

/* วงหมึกที่กระจายออกตอนประทับ */
.toast-stamp::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid var(--ht-type);
    opacity: 0;
    pointer-events: none;
}

.toast-stamp.is-stamping .toast-icon { animation: htStampPress 520ms cubic-bezier(0.3, 0.7, 0.4, 1) 70ms both; }
.toast-stamp.is-stamping::after { animation: htStampInk 560ms ease-out 170ms both; }
.toast-stamp.is-stamping::before { animation: htStampBleed 700ms ease-out 150ms both; }

/* ตรายาง: ลงมาเอียง กดจมนิดหนึ่ง แล้วตั้งตรง */
@keyframes htStampPress {
    0% { transform: scale(1.5) rotate(-16deg); opacity: 0; }
    42% { transform: scale(0.88) rotate(-3deg); opacity: 1; }
    70% { transform: scale(1.04) rotate(1deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes htStampBleed {
    0% { transform: scale(0.7); opacity: 0.28; }
    100% { transform: scale(1.45); opacity: 0; }
}

@keyframes htStampInk {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1.75); opacity: 0; }
}

/* loading: ตรายังไม่ลง - วงอ่อน + จุดหมึก + วงหมุนรอ */
.toast-loading .toast-icon { background: var(--ht-brand-soft); }
.toast-loading .toast-icon .bi { display: none; }
.toast-loading .toast-icon::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ht-loading);
}
.toast-loading .toast-ring { animation: htSpin 900ms linear infinite; }
.toast-loading .toast-progress { stroke-dasharray: 32 81.1; }

@keyframes htSpin {
    from { transform: rotate(-90deg); }
    to { transform: rotate(270deg); }
}

/* ข้อความซ้ำ: ×N ต่อท้ายบรรทัดแรก (ไม่ทับไอคอน ตัวอักษรใหญ่ก็ไม่ชนอะไร) */
.toast-count {
    display: inline-block;
    margin-left: 6px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--ht-chip);
    color: var(--ht-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    vertical-align: 1px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.toast-count[hidden] { display: none; }
.toast-count.is-bump { animation: htBump 320ms var(--ht-ease-spring); }

@keyframes htBump {
    0% { transform: scale(0.6); }
    100% { transform: scale(1); }
}

/* ---------- ข้อความ ---------- */
.toast-content {
    flex: 1 1 auto;
    align-self: center;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ht-text);
}

.toast-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ht-text);
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.toast-notification.has-title .toast-message { margin-top: 1px; color: var(--ht-text-2); }
.toast-list { padding: 0 0 0 18px; white-space: normal; }
.toast-list li + li { margin-top: 2px; }

.toast-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.toast-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: var(--ht-brand-soft);
    color: var(--ht-brand);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}
.toast-action:hover { background: var(--ht-brand); color: var(--ht-surface); text-decoration: none; }
.toast-action .bi { font-size: 12px; line-height: 1; }

/* ---------- ปุ่มปิด ---------- */
.toast-close {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 6px;     /* กลางแนวเดียวกับตรา 40px */
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ht-muted);
    font: inherit;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}
.toast-close:hover { background: var(--ht-hover); color: var(--ht-text); }
.toast-close .bi { font-family: bootstrap-icons; font-size: 14px; line-height: 1; }
.toast-close .bi::before { vertical-align: 0; }

/* ---------- "อีก N รายการ" (กางใบที่พับ - จอสัมผัส/คีย์บอร์ด) ---------- */
.ht-more {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--ht-border);
    border-radius: 999px;
    background: var(--ht-surface);
    color: var(--ht-text-2);
    box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.2);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 320ms var(--ht-ease-move), color 150ms ease;
}
.ht-more[hidden] { display: none; }
.ht-more:hover { color: var(--ht-text); }
/* ใบที่พับมี error/warning/มีปุ่ม */
.ht-more.is-alert { color: var(--ht-error); border-color: var(--ht-error); }
.ht-more .bi { font-size: 12px; line-height: 1; }
.ht-region[data-position$="left"] .ht-more,
.ht-region[data-position$="center"] .ht-more { right: auto; left: 0; }
.ht-region[data-position^="bottom"] .ht-more { top: auto; bottom: 0; }

/* โฟกัสคีย์บอร์ด - แยกกฎ (Safari < 15.4 ไม่รู้จัก :focus-visible แล้วทิ้งทั้งรายการ) */
.toast-close:focus-visible { outline: 2px solid var(--ht-focus); outline-offset: 2px; }
.toast-action:focus-visible { outline: 2px solid var(--ht-focus); outline-offset: 2px; }
.ht-more:focus-visible { outline: 2px solid var(--ht-focus); outline-offset: 2px; }

/* นิ้วกดได้ 44px: ปุ่มปิด 32px + พื้นที่กดล่องหน 6px รอบ (ไม่เลยขอบการ์ด เพราะการ์ดเว้นขวา 6px) */
@media (pointer: coarse) {
    .toast-close { width: 32px; height: 32px; margin-top: 4px; }
    .toast-close::after {
        content: '';
        position: absolute;
        top: -6px;
        right: -6px;
        bottom: -6px;
        left: -6px;
    }
    .ht-more::after {
        content: '';
        position: absolute;
        top: -8px;
        right: 0;
        bottom: -8px;
        left: -4px;
    }
    .toast-action { min-height: 36px; }
}

/* ---------- มือถือ: เต็มกว้าง เว้นขอบ 10px ---------- */
@media (max-width: 575.98px) {
    .ht-region,
    .ht-region[data-position$="left"],
    .ht-region[data-position$="center"] {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        margin-left: 0;
    }

    .toast-notification {
        gap: 10px;
        padding: 10px 6px 10px 10px;
        border-radius: 12px;
    }
}

/* ---------- ลดการเคลื่อนไหว: จางเข้า-ออกอย่างเดียว ไม่ประทับ วงหมุนรอยังหมุน (ช้าลง) ---------- */
@media (prefers-reduced-motion: reduce) {
    .toast-notification,
    .ht-region.ht-css-motion .toast-notification,
    .toast-notification.toast-exiting,
    .ht-more {
        transition: opacity 150ms linear;
    }

    .toast-stamp.is-stamping .toast-icon,
    .toast-stamp.is-stamping::before,
    .toast-stamp.is-stamping::after,
    .toast-count.is-bump {
        animation: none;
    }

    .toast-loading .toast-ring { animation-duration: 1.5s; }
}

/* Windows High Contrast / forced colors: พื้นและเงาถูกตัดทิ้ง - ใช้เส้นขอบระบบแทน ไม่ให้แจ้งเตือนกลืนกับหน้า */
@media (forced-colors: active) {
    .toast-notification { border: 2px solid CanvasText; }
    .toast-icon { border: 2px solid CanvasText; }
    .toast-icon .ht-excl::before,
    .toast-icon .ht-excl::after { forced-color-adjust: none; background: CanvasText; }
    .toast-progress { stroke: Highlight; }
    .toast-ring-track { stroke: GrayText; }
    .toast-count,
    .toast-action,
    .ht-more { border: 1px solid ButtonText; }
    .toast-close:focus-visible { outline-color: Highlight; }
    .toast-action:focus-visible { outline-color: Highlight; }
    .ht-more:focus-visible { outline-color: Highlight; }
}

/* screen reader อย่างเดียว (live region) - fixed: ไม่สร้างแถบเลื่อนให้หน้า */
.ht-live {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Problem dialog (HappyToast.error/warning in frontend "dialog" mode) =====
   Rendered by HappyPopup with customClass.popup = 'hp-problem'. */
.hp-problem .hp-text {
    white-space: pre-line;
    color: #374151;
}

.hp-problem .hp-html-content {
    text-align: left;
}

.hp-problem-list {
    margin: 0;
    padding: 0 0 0 1.25rem;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.6;
}

.hp-problem-list li + li {
    margin-top: 6px;
}

.hp-problem-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hp-problem-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--theme-primary, currentColor);
    border-radius: 10px;
    color: var(--theme-primary, currentColor);
    background: #fff;
    font-weight: 600;
    text-decoration: none;
    word-break: break-word; overflow-wrap: anywhere;
    transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.hp-problem-action:hover {
    color: #fff;
    background: var(--theme-primary);
}

.hp-problem-action:focus-visible {
    outline: 2px solid var(--theme-primary, currentColor);
    outline-offset: 3px;
}

@media (max-width: 575.98px) {
    .hp-problem-list {
        font-size: 0.9rem;
    }
}
/* ---- happy-popup.css ---- */
/**
 * HappyPopup - Custom Popup/Dialog Component
 * Replaces SweetAlert2 with a lightweight, accessible, mobile-responsive popup system
 * Supports: alert, confirm, input, loading, toast modes
 */

/* ========== CSS Variables ========== */
:root {
    --hp-overlay-bg: rgba(0, 0, 0, 0.55);
    --hp-bg: #ffffff;
    --hp-border-radius: 16px;
    --hp-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --hp-font-family: 'Sarabun', 'Prompt', sans-serif;
    --hp-font-heading: 'Prompt', 'Sarabun', sans-serif;
    --hp-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* State Colors */
    --hp-success: #10b981;
    --hp-success-light: #d1fae5;
    --hp-success-dark: #059669;
    --hp-error: #ef4444;
    --hp-error-light: #fee2e2;
    --hp-error-dark: #dc2626;
    --hp-warning: #f59e0b;
    --hp-warning-light: #fef3c7;
    --hp-warning-dark: #d97706;
    --hp-info: #3b82f6;
    --hp-info-light: #dbeafe;
    --hp-info-dark: #2563eb;
    --hp-question: #8b5cf6;
    --hp-question-light: #ede9fe;
    --hp-question-dark: #7c3aed;
    
    /* Button Colors */
    --hp-confirm-bg: #035432;
    --hp-confirm-hover: #023F25;
    --hp-cancel-bg: #6b7280;
    --hp-cancel-hover: #4b5563;
    --hp-deny-bg: #ef4444;
    --hp-deny-hover: #dc2626;
}

/* ========== Overlay ========== */
.hp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hp-overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10500;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--hp-transition), visibility var(--hp-transition);
    padding: 16px;
    box-sizing: border-box;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.hp-overlay.hp-show {
    opacity: 1;
    visibility: visible;
}

/* ========== Modal Container ========== */
.hp-modal {
    background: var(--hp-bg);
    border-radius: var(--hp-border-radius);
    box-shadow: var(--hp-shadow);
    font-family: var(--hp-font-family);
    max-height: calc(100vh - 32px);
    /* 100vh บนมือถือรวมพื้นที่ใต้แถบเครื่องมือของเบราว์เซอร์ - ปุ่มล่างของ popup จมใต้แถบ ใช้ dvh เมื่อรองรับ */
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    position: relative;
    transform: scale(0.7) translateY(20px);
    opacity: 0;
    transition: transform var(--hp-transition), opacity var(--hp-transition);
    padding: 32px 28px 24px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.hp-overlay.hp-show .hp-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ========== Size Variants ========== */
.hp-modal.hp-small {
    max-width: 320px;
}

.hp-modal.hp-medium {
    max-width: 500px;
}

.hp-modal.hp-large {
    max-width: 800px;
}

/* Custom width override */
.hp-modal[style*="max-width"] {
    /* Allow inline style override */
}

/* ========== Icon ========== */
.hp-icon-container {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.hp-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    animation: hp-icon-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hp-icon-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Icon States */
.hp-icon.hp-icon-success {
    background: var(--hp-success-light);
    color: var(--hp-success);
}

.hp-icon.hp-icon-error {
    background: var(--hp-error-light);
    color: var(--hp-error);
}

.hp-icon.hp-icon-warning {
    background: var(--hp-warning-light);
    color: var(--hp-warning);
}

.hp-icon.hp-icon-info {
    background: var(--hp-info-light);
    color: var(--hp-info);
}

.hp-icon.hp-icon-question {
    background: var(--hp-question-light);
    color: var(--hp-question);
}

/* Animated SVG Icons */
.hp-icon svg {
    width: 40px;
    height: 40px;
}

/* Success checkmark animation */
.hp-icon-success .hp-checkmark {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: hp-checkmark-draw 0.5s 0.2s ease forwards;
}

@keyframes hp-checkmark-draw {
    to { stroke-dashoffset: 0; }
}

/* Error X animation */
.hp-icon-error .hp-x-mark {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: hp-x-draw 0.4s 0.2s ease forwards;
}

@keyframes hp-x-draw {
    to { stroke-dashoffset: 0; }
}

/* Warning/Info pulse */
.hp-icon-warning, .hp-icon-info {
    animation: hp-icon-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== Title ========== */
.hp-title {
    font-family: var(--hp-font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px;
    line-height: 1.4;
    word-break: break-word;
}

/* ========== Text / HTML Content ========== */
.hp-text {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 20px;
    line-height: 1.6;
    word-break: break-word;
}

.hp-html-content {
    margin: 0 0 20px;
    text-align: left;
    word-break: break-word;
}

/* ========== Footer ========== */
.hp-footer {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 12px;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

/* ========== Input ========== */
.hp-input-container {
    margin: 16px 0 20px;
}

.hp-input,
.hp-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: var(--hp-font-family);
    font-size: 0.95rem;
    color: #374151;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.hp-input:focus,
.hp-textarea:focus {
    border-color: var(--hp-confirm-bg);
    box-shadow: 0 0 0 3px rgba(8, 99, 55, 0.15);
    background: #fff;
}

.hp-textarea {
    min-height: 100px;
    resize: vertical;
}

.hp-input.hp-input-error,
.hp-textarea.hp-input-error {
    border-color: var(--hp-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ========== Validation Message ========== */
.hp-validation-message {
    display: none;
    color: var(--hp-error);
    font-size: 0.85rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--hp-error-light);
    border-radius: 6px;
    text-align: left;
    animation: hp-shake 0.3s ease;
}

.hp-validation-message.hp-show {
    display: block;
}

@keyframes hp-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
}

/* ========== Buttons ========== */
.hp-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.hp-buttons.hp-reversed {
    flex-direction: row-reverse;
}

.hp-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-family: var(--hp-font-family);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 90px;
    min-height: 44px;
    line-height: 1.2;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.hp-btn:active {
    transform: scale(0.97);
}

.hp-btn:focus-visible {
    outline: 3px solid rgba(8, 99, 55, 0.4);
    outline-offset: 2px;
}

/* Confirm Button */
.hp-btn-confirm {
    background: var(--hp-confirm-bg);
    color: #fff;
}

.hp-btn-confirm:hover {
    background: var(--hp-confirm-hover);
}

/* Cancel Button */
.hp-btn-cancel {
    background: var(--hp-cancel-bg);
    color: #fff;
}

.hp-btn-cancel:hover {
    background: var(--hp-cancel-hover);
}

/* Deny Button */
.hp-btn-deny {
    background: var(--hp-deny-bg);
    color: #fff;
}

.hp-btn-deny:hover {
    background: var(--hp-deny-hover);
}

/* Button Loading State */
.hp-btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.hp-btn-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hp-spin 0.6s linear infinite;
    margin-left: 8px;
}

/* ========== Loading Spinner ========== */
.hp-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.hp-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--hp-confirm-bg);
    border-radius: 50%;
    animation: hp-spin 0.7s linear infinite;
}

@keyframes hp-spin {
    to { transform: rotate(360deg); }
}

.hp-loading-text {
    font-size: 0.95rem;
    color: #6b7280;
}

/* ========== Timer Progress Bar ========== */
.hp-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--hp-confirm-bg);
    border-radius: 0 0 var(--hp-border-radius) var(--hp-border-radius);
    transition: width linear;
    z-index: 1;
}

/* ========== Close Button ========== */
.hp-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 16px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.hp-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ========== Toast Mode ========== */
.hp-overlay.hp-toast-mode {
    background: transparent;
    pointer-events: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    align-items: flex-start;
    justify-content: flex-end;
}

.hp-overlay.hp-toast-mode .hp-modal {
    pointer-events: auto;
    max-width: 380px;
    min-width: 280px;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-align: left;
    margin: 16px;
    transform: translateX(120%);
}

.hp-overlay.hp-toast-mode.hp-show .hp-modal {
    transform: translateX(0);
}

.hp-overlay.hp-toast-mode .hp-icon-container {
    margin: 0;
}

.hp-overlay.hp-toast-mode .hp-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    flex-shrink: 0;
}

.hp-overlay.hp-toast-mode .hp-icon svg {
    width: 20px;
    height: 20px;
}

.hp-overlay.hp-toast-mode .hp-title {
    font-size: 0.95rem;
    margin: 0;
}

.hp-overlay.hp-toast-mode .hp-text {
    font-size: 0.85rem;
    margin: 4px 0 0;
}

.hp-overlay.hp-toast-mode .hp-buttons {
    display: none;
}

.hp-overlay.hp-toast-mode .hp-timer-bar {
    border-radius: 0 0 10px 10px;
}

/* Toast positions */
.hp-overlay.hp-toast-top-end {
    align-items: flex-start;
    justify-content: flex-end;
}

.hp-overlay.hp-toast-top-start {
    align-items: flex-start;
    justify-content: flex-start;
}

.hp-overlay.hp-toast-top-start .hp-modal {
    transform: translateX(-120%);
}

.hp-overlay.hp-toast-top-start.hp-show .hp-modal {
    transform: translateX(0);
}

.hp-overlay.hp-toast-bottom-end {
    align-items: flex-end;
    justify-content: flex-end;
}

.hp-overlay.hp-toast-bottom-end .hp-modal {
    transform: translateX(120%) translateY(0);
}

.hp-overlay.hp-toast-bottom-end.hp-show .hp-modal {
    transform: translateX(0) translateY(0);
}

.hp-overlay.hp-toast-top-center,
.hp-overlay.hp-toast-top {
    align-items: flex-start;
    justify-content: center;
}

.hp-overlay.hp-toast-top-center .hp-modal,
.hp-overlay.hp-toast-top .hp-modal {
    transform: translateY(-120%);
}

.hp-overlay.hp-toast-top-center.hp-show .hp-modal,
.hp-overlay.hp-toast-top.hp-show .hp-modal {
    transform: translateY(0);
}

.hp-overlay.hp-toast-bottom-center,
.hp-overlay.hp-toast-bottom {
    align-items: flex-end;
    justify-content: center;
}

.hp-overlay.hp-toast-bottom-center .hp-modal,
.hp-overlay.hp-toast-bottom .hp-modal {
    transform: translateY(120%);
}

.hp-overlay.hp-toast-bottom-center.hp-show .hp-modal,
.hp-overlay.hp-toast-bottom.hp-show .hp-modal {
    transform: translateY(0);
}

/* ========== Mobile Responsive ========== */
@media (max-width: 767px) {
    .hp-overlay {
        padding: 12px;
    }
    
    .hp-modal {
        padding: 24px 20px 20px;
        border-radius: 14px;
        max-width: calc(100vw - 24px) !important;
    }
    
    .hp-modal.hp-large {
        max-width: calc(100vw - 24px) !important;
    }
    
    .hp-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    
    .hp-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .hp-title {
        font-size: 1.15rem;
    }
    
    .hp-text {
        font-size: 0.9rem;
    }
    
    .hp-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .hp-buttons.hp-reversed {
        flex-direction: column-reverse;
    }
    
    .hp-btn {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
        padding: 12px 20px;
    }
    
    .hp-input, .hp-textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Toast mobile */
    .hp-overlay.hp-toast-mode .hp-modal {
        max-width: calc(100vw - 32px);
        min-width: unset;
        margin: 12px 16px;
    }
}

@media (max-width: 400px) {
    .hp-modal {
        padding: 20px 16px 16px;
    }
    
    .hp-icon {
        width: 52px;
        height: 52px;
        font-size: 26px;
    }
    
    .hp-title {
        font-size: 1.05rem;
    }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
    .hp-modal,
    .hp-overlay,
    .hp-icon,
    .hp-btn,
    .hp-timer-bar {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Focus trap visual indicator */
.hp-modal:focus {
    outline: none;
}

/* Screen reader only text */
.hp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== Custom Class Support ========== */
.hp-modal .btn-theme-primary {
    background: var(--hp-confirm-bg);
    color: #fff;
    border: none;
}

.hp-modal .btn-theme-primary:hover {
    background: var(--hp-confirm-hover);
}

/* ========== Z-index stacking ========== */
.hp-overlay + .hp-overlay {
    z-index: 10501;
}

.hp-overlay + .hp-overlay + .hp-overlay {
    z-index: 10502;
}
/* ---- status-pill.css ---- */
/* ═══════════════════════════════════════════════════════════════════════════
   STATUS PILL → ป้ายสถานะแบบ chip ทั้งระบบ (ดีไซน์เดียวกับ .pkg-badge ค่าบริหาร หน้าจัดการทรัพย์)
   ═══════════════════════════════════════════════════════════════════════════
   ผู้ใช้ตัดสินใจ 2026-10-13 (แทนการตัดสินใจ 2026-09-29 ที่ให้เหลือแค่ไอคอน + ข้อความ): ทุกสถานะเป็นเม็ดยา
   พื้นสีอ่อนตามสถานะ + ไอคอนสีขาวในวงกลมสีสถานะ เหมือนป้ายประเภท/ผู้รับเงิน (.biv-recv ฯลฯ ใน admin-core.css)

   ทุกสีมาจาก currentColor (สีข้อความของสถานะ) จึงใช้ได้กับทุก modifier ทั้งของมาตรฐาน (--success ...) ของ
   แต่ละหน้า (.status-pill.pending, .sp-active, .st-issued ...) และสีจากฐานข้อมูล (style="color:...") โดยไม่ต้อง
   ใช้ color-mix() (iOS 14.5 / Chrome 87 ไม่มี):
     - พื้นสีอ่อน = ::after ทับทั้งป้าย background currentColor + opacity ต่ำ (z-index -1 ใต้ข้อความ)
     - วงกลมไอคอน = background currentColor + ไฮไลต์ขาวไล่สี, ตัวไอคอนขาวด้วย -webkit-text-fill-color
       (เปลี่ยนสีที่วาดตัวอักษร ไม่เปลี่ยน currentColor ที่พื้นวงกลมใช้)

   .status-pill ถูกนิยามซ้ำใน admin-core.css / admin-finance.css / admin-tables.css และใน <style> ของ
   หลายสิบหน้า ไฟล์นี้จึงครอบทับทุกที่จากจุดเดียว: selector นำหน้าด้วย "html body" ให้ specificity สูงกว่ากฎเดิม
   ทุกตัว และ !important เฉพาะคุณสมบัติกล่อง (พื้น/กรอบ/padding/เงา) - ไม่ใส่ !important ที่ display เพราะจะทับ
   .d-none/.d-md-* ของ Bootstrap
   โหลดใน layouts/admin และ layouts/property (ทั้งคู่มี bootstrap-icons ที่ใช้เป็นไอคอน)

   ใช้ใหม่: <span class="status-pill status-pill--success">ชำระแล้ว</span> หรือใส่ <i class="bi ..."> เองก็ได้
   คลาสสถานะของหน้าใบแจ้งหนี้ (.biv-status-*, .inv-status-*, .uiv-status-*) มีไอคอน <i> เสมอ - ใช้กฎชุดเดียวกัน
   ═══════════════════════════════════════════════════════════════════════════ */

html body .status-pill,
html body .biv-status-none,
html body .biv-status-lf-open,
html body .biv-status-waived,
html body .inv-status-pending,
html body .inv-status-approved,
html body .inv-status-rejected,
html body .uiv-status-issued,
html body .uiv-status-pending,
html body .uiv-status-blocked,
html body .uiv-status-skipped {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px 3px 3px !important;
    background: none !important;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    vertical-align: middle;
}

/* พื้นสีอ่อน + เส้นขอบบางๆ สีเดียวกับสถานะ */
html body .status-pill::after,
html body .biv-status-none::after,
html body .biv-status-lf-open::after,
html body .biv-status-waived::after,
html body .inv-status-pending::after,
html body .inv-status-approved::after,
html body .inv-status-rejected::after,
html body .uiv-status-issued::after,
html body .uiv-status-pending::after,
html body .uiv-status-blocked::after,
html body .uiv-status-skipped::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    border-radius: inherit;
    background-color: currentColor;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 100%);
    box-shadow: inset 0 0 0 1px currentColor;
    opacity: 0.13;
    pointer-events: none;
}

/* วงกลมไอคอน: ไอคอน <i> ของป้ายเอง หรือ ::before ที่ไฟล์นี้เติมให้ */
html body .status-pill::before,
html body .status-pill > i,
html body .biv-status-none > i,
html body .biv-status-lf-open > i,
html body .biv-status-waived > i,
html body .inv-status-pending > i,
html body .inv-status-approved > i,
html body .inv-status-rejected > i,
html body .uiv-status-issued > i,
html body .uiv-status-pending > i,
html body .uiv-status-blocked > i,
html body .uiv-status-skipped > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0 !important;
    border-radius: 50%;
    background-color: currentColor;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
    -webkit-text-fill-color: #fff;
    font-size: 0.6rem;
    line-height: 1;
    opacity: 1;
}

html body .status-pill > i::before,
html body .biv-status-none > i::before,
html body .biv-status-lf-open > i::before,
html body .biv-status-waived > i::before,
html body .inv-status-pending > i::before,
html body .inv-status-approved > i::before,
html body .inv-status-rejected > i::before,
html body .uiv-status-issued > i::before,
html body .uiv-status-pending > i::before,
html body .uiv-status-blocked > i::before,
html body .uiv-status-skipped > i::before {
    line-height: 1;
    vertical-align: 0;
}

/* ค่าเริ่มต้น (modifier ที่ไม่มีไอคอนประจำ และไม่มี <i>): จุดขาวกลางวงกลม */
html body .status-pill::before {
    content: '';
    background-image: radial-gradient(circle, #fff 0, #fff 2.5px, rgba(255, 255, 255, 0) 3px),
        linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
}

/* pill ที่มีไอคอน <i> ของตัวเองอยู่แล้ว - ไม่เติมวงกลมซ้ำ */
html body .status-pill:has(> i)::before {
    display: none;
}

/* ── ไอคอนประจำสถานะมาตรฐาน (bootstrap-icons) ── */
html body .status-pill--success::before,
html body .status-pill--invoiced::before,
html body .status-pill--warning::before,
html body .status-pill--warning-alt::before,
html body .status-pill--pending::before,
html body .status-pill--info::before,
html body .status-pill--danger::before {
    font-family: 'bootstrap-icons';
    font-weight: normal;
    font-style: normal;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    -webkit-font-smoothing: antialiased;
}

html body .status-pill--success::before,
html body .status-pill--invoiced::before { content: '\f633'; }      /* check-lg */
html body .status-pill--warning::before,
html body .status-pill--warning-alt::before,
html body .status-pill--pending::before { content: '\f291'; }       /* clock-fill */
html body .status-pill--info::before { content: '\f41f'; }          /* hourglass-split */
html body .status-pill--danger::before { content: '\f332'; }        /* exclamation-circle-fill */

/* ── สีสถานะ (ข้อความ + วงกลม + พื้นอ่อน มาจากสีนี้ทั้งหมด) ── */
html body .status-pill--success { color: #047857; }
html body .status-pill--invoiced { color: #035432; }
html body .status-pill--primary { color: #035432; }
html body .status-pill--warning,
html body .status-pill--pending { color: #b45309; }
html body .status-pill--warning-alt { color: #c2410c; }
html body .status-pill--info { color: #0369a1; }
html body .status-pill--danger { color: #b91c1c; }
html body .status-pill--secondary { color: #64748b; }
html body .status-pill--dark { color: #334155; }
html body .status-pill--indigo { color: #4338ca; }
html body .status-pill--purple { color: #6d28d9; }
html body .status-pill--custom { color: var(--pill-fg, #475569); }

/* สีจากฐานข้อมูล (สถานะทรัพย์ ฯลฯ ใส่ style="color:..." หรือ --custom) อาจอ่อนเกินไปสำหรับตัวหนังสือ (เช่น เหลือง
   #ffc107 ของ "จอง") - วงกลม/พื้นอ่อนเป็นสีสถานะ แต่ตัวหนังสือเป็นเทาเข้มอ่านออกเสมอ */
html body .status-pill--custom,
html body .status-pill[style*="color"] {
    -webkit-text-fill-color: #334155;
}

html body .status-pill--custom::before,
html body .status-pill[style*="color"]::before,
html body .status-pill--custom > i,
html body .status-pill[style*="color"] > i {
    -webkit-text-fill-color: #fff;
}

/* modifier เฉพาะหน้าที่เดิมใช้เทาอ่อน - เข้มขึ้นให้อ่านออก */
html body .status-pill.inactive,
html body .status-pill.sp-inactive,
html body .status-pill.draft {
    color: #64748b;
}

/* บนแถบหัวสีเขียว (.page-header) - ป้ายขาวโปร่ง ข้อความขาว วงกลมขาว ไอคอนเขียว */
html body .page-header .status-pill {
    color: rgba(255, 255, 255, 0.95);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.95);
}

html body .page-header .status-pill::after {
    opacity: 0.18;
}

html body .page-header .status-pill::before,
html body .page-header .status-pill > i {
    background-color: #fff;
    -webkit-text-fill-color: #035432;
}
