
/* =======================
   FILTER CARD CONTAINER
======================= */
.filter-card {
    background: white;
    padding: 18px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    overflow-x: auto;   /* กันล้นจอ */
}

/* =======================
   FILTER ROW LAYOUT
======================= */
.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: nowrap;     /* 👉 บังคับแถวเดียวบนจอใหญ่ */
}

/* =======================
   GROUP BLOCK
======================= */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;     /* ไม่ยืด ไม่หด */
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
}

/* =======================
   INPUT / SELECT COMMON
======================= */
.filter-group select,
.filter-group input {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 8px 12px;
    font-size: 14px;
    background: white;
}

/* =======================
   WIDTH CONTROL
======================= */
#viewMode     { width: 120px; }
#sortMode     { width: 160px; }
#filterDate   { min-width: 130px; }
#filterMonth  { min-width: 170px; }
#filterZone   { min-width: 140px; }
#filterBranch { min-width: 140px; }
#filterSearch { width: 200px; }

/* =======================
   SEARCH SPECIAL
======================= */
.search-group input {
    padding-left: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 16px;
}

/* =========================================
   2. HEADER & SUMMARY (สรุปยอด)
   ========================================= */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.summary-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge-stat {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bg-gray {
    background: #f1f5f9;
    color: #475569;
}

.bg-green {
    background: #dcfce7;
    color: #166534;
}

.bg-red {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================================
   3. DATA TABLE (ตารางข้อมูล) - จุดสำคัญ!
   ========================================= */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    /* ให้เลื่อนแนวนอนได้ในมือถือ */
    border-radius: 12px;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    min-width: 1000px;
    /* 🔥 บังคับความกว้างขั้นต่ำ (กันเบียด) */
    border-collapse: collapse;
    table-layout: fixed;
    /* 🔥 สำคัญมาก! ล็อกความกว้างคอลัมน์ให้เป๊ะ */
}

/* --- การจัดตำแหน่ง (ใช้กับทั้ง th และ td) --- */
.cell-center {
    text-align: center !important;
}

.cell-left {
    text-align: left !important;
}

/* --- สไตล์หัวตาราง (th) --- */
.data-table th {
    padding: 16px;
    background-color: #f8fafc;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    /* ห้ามขึ้นบรรทัดใหม่ */
}

/* --- สไตล์ข้อมูล (td) --- */
.data-table td {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 14px;
    color: var(--text-main);

    /* ตัดคำถ้าล้น */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* --- กำหนดความกว้างคอลัมน์ (รวมกัน = 100%) --- */
.w-date {
    width: 12%;
}

.w-id {
    width: 10%;
}

.w-name {
    width: 20%;
}

.w-time {
    width: 12%;
}

/* เข้า */
.w-time {
    width: 12%;
}

/* ออก */
.w-branch {
    width: 15%;
}

.w-map {
    width: 19%;
}

/* --- องค์ประกอบย่อยในตาราง --- */
.col-id {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-block;
    margin-left: 5px;
}

.user-name {
    font-weight: 600;
    display: block;
}

/* ป้ายเวลา (Time Box) */
.time-box {
    display: inline-block;
    width: 80px;
    /* ล็อกความกว้างป้ายเวลา */
    padding: 4px 0;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    margin-left: 10px;
}

.time-in {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.time-out {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.time-empty {
    background: #f1f5f9;
    color: #cbd5e1;
    font-weight: normal;
}

/* ปุ่มแผนที่ */
.btn-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    background-color: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: 0.2s;
}

.btn-map:hover {
    background-color: var(--primary);
    color: white;
}

.text-center {
    text-align: center;
    padding: 40px;
    color: var(--text-sub);
}

/* =========================================
   4. MOBILE RESPONSIVE (มือถือ)
   ========================================= */
@media (max-width: 768px) {

    /* ปรับ Filter ให้เรียงลงมา */
        .filter-row {
        flex-wrap: wrap;  /* 👉 จอเล็กแตกบรรทัด */
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    .sortMode {
        max-width: 15px;
    }

    #filterDate   { min-width: 130px; }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-badges {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }

    .badge-stat {
        flex: 1;
        justify-content: center;
        font-size: 12px;
    }
}

/* สั่งให้ทุก element คิดขนาดรวมขอบและ padding (กันเบี้ยว) */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- บังคับทิศทางข้อความใน td ให้ตรงกับ th ตามลำดับ --- */

/* คอลัมน์ 1: วันที่ (th=Left -> td=Left) */
.data-table tbody td:nth-child(1) {
    text-align: left;
}

/* คอลัมน์ 2: ID (th=Center -> td=Center) */
.data-table tbody td:nth-child(2) {
    text-align: center;
}

/* คอลัมน์ 3: พนักงาน (th=Left -> td=Left) */
.data-table th:nth-child(3) {
    padding-left: 45px !important;
}

.data-table tbody td:nth-child(3) {
    text-align: left;
}

/* คอลัมน์ 4: เวลาเข้า (th=Center -> td=Center) */
.data-table tbody td:nth-child(4) {
    text-align: center;
}

/* คอลัมน์ 5: เวลาออก (th=Center -> td=Center) */
.data-table tbody td:nth-child(5) {
    text-align: center;
}

/* คอลัมน์ 6: สาขา (th=Left -> td=Left) */
.data-table tbody td:nth-child(6) {
    text-align: left;
}

/* คอลัมน์ 7: พิกัด (th=Center -> td=Center) */
.data-table tbody td:nth-child(7) {
    text-align: center;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    padding-left: 80px !important;
    /* ของเดิม 16px เพิ่มเป็น 30px ให้มันถอยห่างออกมา */
}

CSS
/* =========================================
   7. BADGE COLORS (แต่งปุ่มสถานะด้านบน)
   ========================================= */

/* สไตล์พื้นฐานของทั้ง 3 ปุ่ม (จัดระยะ, ความมน) */
.badge-total,
.badge-in,
.badge-out {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* ระยะห่างระหว่างตัวหนังสือกับตัวเลข */
    padding: 8px 16px;
    /* ความอ้วนของปุ่ม */
    border-radius: 30px;
    /* มนๆ เหมือนแคปซูล */
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    /* ดันปุ่มถัดไปให้ห่างออกไป ไม่ติดกัน */
    border: 1px solid transparent;
    /* เตรียมเส้นขอบไว้ */
}

/* 1. พนักงานทั้งหมด (สีฟ้า - ให้ดูเป็นกลาง) */
.badge-total {
    background-color: #f2f2f2;
    color: #1e40af;
    border-color: #b3d1f6;
    border-radius: 30px;
    padding: 8px 16px;
    border: 1px;
}

/* 2. เช็คอิน (สีเขียว - ตามสั่ง) */
.badge-in {
    background-color: #f2f2f2;
    color: #166534;
    border-color: #e9fff0;
}

/* 3. เช็คเอาท์ (สีแดง - ตามสั่ง) */
.badge-out {
    background-color: #f2f2f2;
    color: #991b1b;
    border-color: #ffe8e8;
}

/* ... (โค้ดเดิมของมึงข้างบนเก็บไว้) ... */

/* =========================================
   8. CUSTOM MODAL (แก้ใหม่ ไม่ให้ค้าง)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* ฉากหลังสีดำโปร่งแสง */
    display: none;
    /* ซ่อนไว้ก่อน */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* อยู่บนสุดแน่นอน */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Class นี้จะถูกเติมด้วย JS เมื่อสั่งเปิด */
.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    text-align: center;
    /* จัดกลางให้สวย */
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 22px;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.btn-cancel,
.btn-confirm {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-confirm {
    background: #0ea5e9;
    color: white;
}

.btn-confirm:hover {
    background: #0284c7;
}


/* --- Modal & Profile Card Styling --- */
.clickable-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-row:hover {
    background-color: #f8fafc;
    transform: scale(1.005);
    z-index: 1;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.modal-overlay.open {
    opacity: 1;
}

.profile-card {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    padding: 25px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .profile-card {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #ef4444;
}

.profile-header-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.profile-title h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
}

.badge-pos {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.p-item {
    display: flex;
    flex-direction: column;
}

.p-item.full-width {
    grid-column: span 2;
}

.p-item label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 2px;
    font-weight: 500;
}

.p-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
}

.acc-no {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    text-align: center;
    font-weight: 600 !important;
}

.divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
}

.section-title {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #475569;
    font-weight: 600;
}

/* --- Stats Section ใน Modal --- */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* แบ่ง 3 ช่อง */
    gap: 15px;
    margin-bottom: 15px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-info h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #1e293b;
}

.stat-info small {
    color: #64748b;
    font-size: 0.75rem;
}

/* สีแยกแต่ละกล่อง */
.stat-box.work .stat-icon {
    background: #dbeafe;
    color: #2563eb;
}

/* สีฟ้า */
.stat-box.late .stat-icon {
    background: #fee2e2;
    color: #dc2626;
}

/* สีแดง */
.stat-box.leave .stat-icon {
    background: #dcfce7;
    color: #166534;
}

/* สีเขียว */

/* ปรับ Map ให้สวยขึ้นอีกนิด */
#mMapLink .btn-outlinem {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    padding: 3px 16px;
    background: rgb(247, 247, 247);
    color: #3572ff;
    border-bottom: 2px solid #0bb86a;
    gap: 5px;
    margin-top: 10px;
    border-radius: 9px;
    box-shadow: #1e293b33 0px 2px 4px;

    font-weight: bold;
}

#mMapLink .btn-outlinem:hover {
    background: #e4eef1;
    border-bottom: 2px solid #d21c19;
    color: rgb(24, 190, 96);
    box-shadow: 0 2px 4px rgba(8, 11, 16, 0.35);
}

/*Export*/
.export-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-outline {
    display: flex;
    align-items: center;
    gap: 5px;
    border-bottom: 2px solid #5db068;
    color: #059200;
    background: rgb(255, 255, 255);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: #1e293b33 0px 2px 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #56c977;
    border-bottom: 2px solid #509c5a;
    color: white;
    box-shadow: 0 2px 4px rgba(8, 11, 16, 0.35);
}

#btnExport {
    display: none;
}
.btn-raw {
    display: flex;
    align-items: center;
    gap: 5px;
    border-bottom: 2px solid #2c82c9;
    color: #1565c0;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: #1e293b33 0px 2px 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    margin-left: 10px;
}

.btn-raw:hover {
    background: #3ea0e0;
    border-bottom: 2px solid #2e73aa;
    color: white;
    box-shadow: 0 2px 4px rgba(8, 11, 16, 0.35);
}

/* --- Stats Section (Layout: Label Top / Row Bottom) --- */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    /* เรียงแนวตั้ง: เอา label ไว้บน */
    align-items: flex-start;
    /* ชิดซ้าย */
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* จัดการ Label */
.stat-box small {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 8px;
    /* เว้นระยะห่างจากตัวเลข */
    white-space: nowrap;
}

/* จัดกลุ่ม Emoji + ตัวเลข ให้อยู่บรรทัดเดียวกัน */
.stat-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    /* ระยะห่างระหว่าง Emoji กับเลข */
    width: 100%;
}

/* Style Emoji Icon */
.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

/* Style ตัวเลข */
.stat-value-row h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #1e293b;
    line-height: 1;
}

/* สีแยกแต่ละ Theme */
.stat-box.work .stat-icon {
    background: #dbeafe;
    color: #2563eb;
}

.stat-box.late .stat-icon {
    background: #fee2e2;
    color: #dc2626;
}

.stat-box.leave .stat-icon {
    background: #ffedd5;
    color: #c2410c;
}

/*ป้ายวันหยุด*/

/* ป้ายกรณีลาหยุด */
.leave-badge {
    display: inline-block;
    margin-left: 8px;
    background: #ff7878;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

/* แถวสำหรับลาหยุด */
.leave-row {
    background-color: #ffe9e9;
    opacity: 0.95;
}


/* ป้ายวันหยุดปกติ */
.day-off-badge {
    display: inline-block;
    margin-left: 8px;
    background: #b3becc;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

/* ป้ายกรณีทำงานในวันหยุด (เด่นกว่า) */
.day-work-badge {
    display: inline-block;
    margin-left: 8px;
    background: #ffb65d;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(180, 83, 9, 0.12);
}

/* แถวสำหรับวันหยุดปกติ (existing) */
.day-off-row {
    background-color: #eaf9ff;
    opacity: 0.95;
}

/* แถวสำหรับกรณีทำงานวันหยุด - เน้นด้วยสีอุ่น */
.day-work-row {
    background-color: #fdffde;
    box-shadow: inset 0 0 0 1px rgba(217, 115, 14, 0.06);
}

/* กล่องรวมปุ่ม */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* ปุ่มพื้นฐาน */
.filter-btn {
    padding: 4px 16px;
    border-radius: 8px;
    border: none;
    border-bottom: #d6d6d6 2px solid;
    background: #f1f5f9;
    /* slate-100 */
    color: #334155;
    /* slate-700 */
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: 0.18s ease;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

/* hover สวยๆ */
.filter-btn:hover {
    background: #e2e8f0;
    /* slate-200 */
    transform: translateY(-1px);
}

/* ACTIVE = โหมดที่ถูกเลือก */
.filter-btn.active {
    background: linear-gradient(135deg, #5c99fb, #2563eb);
    border-bottom: #555eaf 2px solid;
    /* ฟ้าเข้ม gradient */
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

/* เมื่อ active แล้ว hover ก็ให้เล่นนิดเดียว */
.filter-btn.active:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/*ป้ายเตือนวันออก*/
.exit-warning-badge {
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
    margin-left: 6px;
    font-weight: bold;
    animation: blinkWarning 1.2s infinite;
}

@keyframes blinkWarning {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}
/*เน็ตเวิร์ก*/
.net-badge {
    font-size: 0.65rem;
    color: #6b7280;
    margin-top: 2px;
    letter-spacing: 0.2px;
}
/* แถบพิเศษ 3 ปุ่ม */
.special-filter{
  display:flex !important;
  justify-content: center !important;   /* ✅ กลางจอ */
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px dashed #ccc;
  margin-bottom: 8px;
  flex-wrap: nowrap;         /* ✅ แถวเดียว */
}

/* ปุ่ม */
.special-filter .filter-btn{
  height: 34px;
  padding: 0 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  white-space: nowrap;
}

/* สี */
#btnLate.active{ background:#dc2626; color:white; }
#btnLeave.active{ background:#2563eb; color:white; }
#btnDayWork.active{ background:#16a34a; color:white; }

/*ตัวนับ*/
.filter-btn {
  position: relative;
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #fcf9f9;
  color: rgb(255, 44, 44);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0px 0px;
  border: #ff1f1f 1px solid;
  border-radius: 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
  display: none;
  pointer-events: none;
}
