/* ==========================================
   1. ตัวแปรตั้งต้น (Variables)
   ========================================== */
:root {
    --topbar-height: 60px;
    --sidebar-width: 350px;
    --sidebar-collapsed-width: 60px;
    --primary-color: #224943;
    --accent-color: #cb0000;
    --text-main: #333333;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Sarabun', sans-serif;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: #224943;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    height: 40px;
    width: auto;
}

.system-name {
    font-size: 1.5rem;
    font-weight: bold;
    /* color: var(--primary-color); */
    color: #ffffff;
}

.search-panel {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    z-index: 500;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid #eee;
}

.panel-header h1 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 250px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.panel-body::-webkit-scrollbar {
    display: none;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-main);
}

.loader {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 10px;
    font-size: 0.9rem;
}

.info-card {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-size: 0.9rem;
}

.info-card h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: var(--primary-color);
}



/* ==========================================
   5. สถานะพับ Sidebar (Collapsed State)
   ========================================== */
.search-panel.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* 🌟 แก้ไขตรงนี้: สั่งซ่อนทุกอย่างที่ไม่ใช่ไอคอนตอนที่ Sidebar ยุบอยู่ */
.search-panel.collapsed .main-content,
.search-panel.collapsed .panel-header .title,
.search-panel.collapsed .search-tabs,
.search-panel.collapsed .info-card {
    display: none;
}

.mini-rail-icons {
    display: none;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    gap: 20px;
}

.search-panel.collapsed .mini-rail-icons {
    display: flex;
}

.mini-icon {
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 1;
    transition: 0.2s;
}

.mini-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.toggle-rail-btn {
    position: absolute;
    right: -12px;
    top: 45%;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 1001;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.search-panel.collapsed .toggle-rail-btn {
    transform: rotate(180deg);
}

.search-panel.collapsed .panel-header {
    display: none;
}

.search-panel.collapsed .panel-body {
    padding-top: 50px;
}

/* ==========================================
   6. แผนที่ และอื่นๆ
   ========================================== */
#map {
    position: absolute;
    top: var(--topbar-height);
    bottom: 0;
    right: 0;
    left: var(--sidebar-width);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.search-panel.collapsed~#map {
    left: var(--sidebar-collapsed-width);
}

.basemap-panel {
    position: absolute;
    top: calc(var(--topbar-height) + 20px);
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 10;
    overflow: hidden;
}

.basemap-toggle {
    display: flex;
}

.basemap-btn {
    background: #fff;
    border: none;
    padding: 8px 8px;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 6px;
}

.basemap-btn:last-child {
    border-right: none;
}

.basemap-btn:hover {
    background: #f8f9fa;
}

.basemap-btn.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: bold;
}

.maplibregl-ctrl-top-right {
    top: calc(var(--topbar-height) + 70px) !important;
}

.choices__inner {
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #fff;
    min-height: 20px;
    padding: 4px 8px 0px 8px;
    width: var(--choices-width, 93%);
}

.choices__list--dropdown {
    z-index: 20;
}

.choices[data-type*="select-one"] .choices__input {
    font-family: 'Sarabun', sans-serif;
}

.mobile-float-btn {
    display: none;
}

@media (max-width: 1000px) {
    .system-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    #map {
        left: 0 !important;
    }

    .system-name {
        font-size: 0.9rem;
    }

    .mobile-float-btn {
        display: block;
        position: absolute;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 30px;
        font-size: 1rem;
        font-family: 'Sarabun', sans-serif;
        box-shadow: 0 4px 12px rgb(17 132 81 / 35%);
        z-index: 5;
        cursor: pointer;
    }

    .search-panel {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100% !important;
        height: 75vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(120%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2000;
        border-right: none;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }

    .search-panel.active {
        transform: translateY(0);
    }

    .close-btn {
        display: block;
    }

    .toggle-rail-btn {
        display: none;
    }

    .panel-body {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 50px;
    }

    .panel-body:has(.is-open) {
        overflow: visible !important;
    }

    .search-panel:has(.is-open) {
        overflow: visible !important;
    }

    .choices[data-type*="select-one"] .choices__list--dropdown {
        bottom: 100% !important;
        top: auto !important;
        margin-bottom: 5px !important;
        z-index: 9999 !important;
        border-radius: 8px !important;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.2) !important;
    }

    .choices__list--dropdown .choices__list {
        max-height: 200px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Map Controls */
.maplibregl-ctrl-top-left {
    top: 15px !important;
    left: 15px !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maplibregl-ctrl-top-left .maplibregl-ctrl {
    margin: 0 !important;
}

.maplibregl-ctrl-group {
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
    border: none !important;
    background: #fff !important;
}

.maplibregl-ctrl-group button {
    width: 36px !important;
    height: 36px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: background-color 0.2s ease;
}

.maplibregl-ctrl-group button:last-child {
    border-bottom: none !important;
}

.maplibregl-ctrl-group button:hover {
    background-color: #f4f6f8 !important;
}

.maplibregl-ctrl-icon {
    filter: opacity(0.7);
    transition: filter 0.2s ease;
}

.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon {
    filter: opacity(1);
}

.maplibregl-ctrl-bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

.maplibregl-ctrl-scale {
    background-color: rgba(255, 255, 255, 0.85) !important;
    border: 2px solid var(--primary-color) !important;
    border-top: none !important;
    color: var(--primary-color) !important;
    font-family: 'Sarabun', sans-serif !important;
    font-weight: bold;
    font-size: 12px !important;
    padding: 4px 8px !important;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* PDF Viewer */
.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(0px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pdf-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pdf-modal-content {
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden; 
    
    /* 🌟 ปรับขนาดเริ่มต้นให้เหมาะสม และกำหนดขีดจำกัด */
    width: 1000px;         /* ขนาดกว้างเริ่มต้น */
    height: 80vh;         /* ความสูงเริ่มต้น */
    max-width: 95vw;      /* ให้ลากขยายได้เกือบเต็มจอ */
    max-height: 95vh;     /* ให้ลากขยายได้เกือบเต็มจอ */
    min-width: 350px;     /* ป้องกันการย่อจนเล็กเกินไป */
    min-height: 300px;    
    
    /* 🌟 เปิดฟังก์ชันลากย่อขยายที่มุมขวาล่าง */
    resize: both;         
}

.pdf-modal.active .pdf-modal-content {
    transform: translateY(0);
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--primary-color);
    color: #fff;
}

.pdf-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

/* เปลี่ยนเมาส์เป็นรูปมือตอนเอาไปชี้ที่ Header ของ PDF */
.pdf-modal-header {
    cursor: grab; 
    user-select: none; /* ป้องกันการเผลอคลุมดำตัวหนังสือตอนลาก */
}

/* เปลี่ยนเป็นรูปมือขยุ้มตอนที่คลิกเมาส์ค้างไว้ */
.pdf-modal-header:active {
    cursor: grabbing;
}

.close-pdf-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-pdf-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* 2. หาคลาสนี้ แล้วเพิ่ม Padding ด้านล่าง */
.pdf-modal-body {
    flex: 1;
    width: 100%;
    background: #525659;
    
    /* 🌟 ทริคสำคัญ: เว้นพื้นที่สีเทาด้านล่างไว้ 15px */
    /* padding-bottom: 15px;  */
}

.pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .pdf-modal {
        padding: 10px;
    }

    .pdf-modal-content {
        height: 95vh;
    }
}

/* Tabs System */
.search-tabs {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    font-weight: bold;
    color: #888;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coord-input,
.default-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.coord-input:focus,
.default-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.1);
}

.primary-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    margin-top: 10px;
    transition: background 0.2s;
}

/* ==========================================
   12. Empty State (หน้าจอรอข้อมูล)
   ========================================== */
   .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 25px 15px 15px 15px;
}

.empty-state svg {
    margin-bottom: 15px;
    opacity: 0.7;
    /* ใส่แอนิเมชันให้ไอคอนขยับขึ้นลงเบาๆ ให้ดูมีชีวิตชีวา */
    animation: floatIcon 3s ease-in-out infinite;
}

.empty-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 0 8px 0;
}

.empty-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    color: #666;
}

@keyframes floatIcon {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* ==========================================
   13. Modern Map Popup (แสดงเฉพาะ Desktop)
   ========================================== */
   .modern-popup .maplibregl-popup-content {
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-family: 'Sarabun', sans-serif;
    overflow: hidden;
    border: none;
    min-width: 280px;
}

/* ปุ่มกากบาทปิด Popup */
.modern-popup .maplibregl-popup-close-button {
    color: #fff;
    font-size: 1.5rem;
    padding: 2px 8px;
    transition: background 0.2s;
}

.modern-popup .maplibregl-popup-close-button:hover {
    background-color: rgba(255,255,255,0.2);
    border-radius: 0 12px 0 0;
}

/* ส่วนหัว */
.popup-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 15px;
    font-size: 1.05rem;
    font-weight: bold;
}

/* ส่วนเนื้อหา */
.popup-body {
    padding: 15px;
    font-size: 0.9rem;
    color: #444;
    background: #fff;
}

.popup-body p {
    margin: 0 0 8px 0;
    line-height: 1.4;
    border-bottom: 1px dashed #eee;
    padding-bottom: 4px;
}
.popup-body p:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* ส่วนปุ่มกดด้านล่าง */
.popup-footer {
    display: flex;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.popup-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.2s;
}

.popup-btn:hover { background: #eee; }
.popup-btn.pdf-btn { color: #d32f2f; border-right: 1px solid #eee; }
.popup-btn.nav-btn { color: #388e3c; }

/* จัดส่วนหัวของบัตรข้อมูลให้มีปุ่มซูม */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0 !important; /* รีเซ็ต margin ของเดิม */
    font-size: 1.1rem;
    color: var(--primary-color);
}

.zoom-parcel-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.zoom-parcel-btn:hover {
    background: #002244;
    transform: scale(1.05);
}

.zoom-parcel-btn svg {
    width: 20px;
    height: 20px;
}

.maplibregl-ctrl-bottom-right {
    bottom: 0px !important;
    right: 0px !important;
}

/* ==========================================
   แก้ปัญหากรอบดำเวลาปุ่มถูกคลิกหรือถูก Focus
   ========================================== */
   button:focus,
   #attribute-content button:focus,
   .popup-btn:focus,
   .zoom-parcel-btn:focus {
       outline: none !important;
       box-shadow: none !important;
       /* ช่วยลดแสงกระพริบสี่เหลี่ยมตอนใช้นิ้วจิ้มบนมือถือ Android/iOS */
       -webkit-tap-highlight-color: transparent !important; 
   }

   /* ==========================================
   ตกแต่งผลลัพธ์การค้นหาสถานที่
   ========================================== */
.results-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    line-height: 1.4;
}

.result-item:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.result-item strong {
    color: var(--primary-color);
    font-size: 1rem;
    display: block;
    margin-bottom: 4px;
}

.result-item small {
    color: #666;
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* ตัดบรรทัดถ้าข้อความยาวเกินไป */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   จัดตำแหน่ง Top Bar ให้มีซ้าย-ขวา
   ========================================== */
   .top-bar {
    justify-content: space-between; /* แยกแบรนด์กับปุ่มออกจากกัน */
}

.staff-access-btn {
    background-color: #f1c40f;
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Sarabun', sans-serif;
}

.staff-access-btn:hover {
    background-color: #ffd940;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.login-icon {
    width: 20px;
    height: 20px;
    display: none; /* ซ่อนไอคอนในหน้าจอปกติ */
}

/* ==========================================
   Responsive: เปลี่ยนข้อความตัวหนังสือเป็นไอคอนในมือถือ
   ========================================== */
@media (max-width: 768px) {
    .staff-access-btn {
        padding: 8px;
        border-radius: 50%; /* ทำปุ่มให้กลมในมือถือ */
    }
    
    .staff-access-btn .btn-label {
        display: none; /* ซ่อนตัวหนังสือ */
    }
    
    .staff-access-btn .login-icon {
        display: block; /* แสดงไอคอนแทน */
    }

    /* .system-name {
        font-size: 0.85rem; 
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    } */
}

/* ==========================================
   ส่วนท้ายของแถบ Sidebar (Panel Footer)
   ========================================== */
   .panel-footer {
    padding: 5px 15px;
    background-color: #fcfcfc;
    border-top: 1px solid #eee;
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    transition: opacity 0.2s ease;
}

.footer-content p {
    margin: 0px 0;
    line-height: 1.4;
}

.version-text {
    font-weight: bold;
    color: #bbb;
    margin-top: 5px !important;
}

/* 🌟 จัดการสถานะเมื่อพับ Sidebar: ให้ซ่อน Footer ไปเลยเพื่อความสวยงาม */
.search-panel.collapsed .panel-footer {
    display: none;
}

/* ปรับปรุง .panel-body เล็กน้อยเพื่อให้ Footer ถูกดันลงล่างสุดจริงๆ */
.panel-body {
    flex: 1; /* กินพื้นที่ที่เหลือทั้งหมด */
    padding-bottom: 20px; /* ลด padding-bottom เดิมที่เคยตั้งไว้สูงๆ ออก */
}

/* ทำให้ Footer ดูเหมือนปุ่มที่คลิกได้ */
.panel-footer {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.panel-footer:hover {
    background-color: #f0f4f8; /* เปลี่ยนสีพื้นหลังเล็กน้อยตอนเอาเมาส์ชี้ */
}

/* ==========================================
   ปรับปรุง Footer ในมือถือให้บางและกะทัดรัด (Compact Mobile Footer)
   ========================================== */
   @media (max-width: 768px) {
    .panel-footer {
        padding: 3px 15px; /* ลดความหนาลงเหลือเพียงเล็กน้อย */
        background-color: #f9f9f9;
        border-top: 1px solid #eee;
    }

    .footer-content {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 3px; /* ระยะห่างระหว่างข้อความ */
        flex-wrap: nowrap; /* บังคับให้อยู่บรรทัดเดียว */
    }

    .footer-content p {
        margin: 0;
        font-size: 0.65rem; /* ขนาดตัวอักษรเล็กลงเพื่อความกะทัดรัด */
        color: #999;
        white-space: nowrap;
    }

    /* 🌟 เทคนิค: ใส่ตัวแบ่งคั่นระหว่างข้อความ */
    /* .footer-content p:not(:last-child)::after {
        content: "|";
        margin-left: 6px;
        color: #ddd;
    } */

    /* ซ่อนเวอร์ชันในมือถือเพื่อประหยัดพื้นที่ */
    .version-text {
        display: none; 
    }

    /* ปรับปรุงให้ Panel Body มีพื้นที่เพิ่มขึ้น */
    .panel-body {
        padding-bottom: 10px;
    }
}

/* ==========================================
   แก้ปัญหาเลเยอร์ซ้อนทับกันบนมือถือ (Z-Index Fix)
   ========================================== */

/* 1. ดันกล่องข้อความ SweetAlert2 ให้ลอยอยู่เหนือแผงค้นหา (2000) */
div:where(.swal2-container) {
    z-index: 3000 !important;
}

/* 2. ดันหน้าต่าง PDF Modal ให้ลอยอยู่เหนือแผงค้นหา */
.pdf-modal {
    z-index: 3000 !important; 
}

/* (ถ้ามี) ให้ปุ่มกากบาทของ PDF Modal อยู่บนสุดด้วยเพื่อกันการกดไม่ติด */
.close-pdf-btn {
    z-index: 3001 !important;
}