/* ================================
   manage_employee.css (Kanit & Mobile Optimized)
================================ */

/* 1. Import Font Kanit */
@import url('https://fonts.googleapis.com/css2?family=Mitr:wght@200;300;400;500;600;700&family=Prompt');

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --border: #e2e8f0;
    --bg-body: #f1f5f9;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
}

/* 2. บังคับใช้ Kanit ทุกที่ */
* {
    font-family: 'Prompt', sans-serif;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    margin: 0;
    /* padding-left sidebar จัดการที่ layout หลัก */
}

.section-title {
    font-size: 18px; /* ลดลงนิดนึงให้ดูคลีน */
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* ================================
   Form Row (Input + Button)
================================ */
.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.form-row input {
    flex: 1;
    height: 44px; /* Desktop ปกติ */
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: 0.2s;
}

.form-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    border: none;
    padding: 0 20px;
    height: 44px;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap; /* ห้ามตัดคำ */
    transition: 0.2s;
}
.btn-primary:hover {
    background: #2c2d80;
}

/* ================================
   Filter & Search (Mobile Optimized)
================================ */
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap; /* ห้ามขึ้นบรรทัดใหม่มั่วซั่ว */
}

/* กลุ่มปุ่มตัวกรอง */
.filter-group {
    display: flex;
    gap: 6px;
    flex-shrink: 0; /* ห้ามหดจนเสียทรง */
}

.filter-btn {
    background: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-size: 13px;
    cursor: pointer;
    color: #386783;
    font-weight: 400;
    white-space: nowrap; /* ห้ามขึ้นบรรทัดใหม่ในปุ่ม */
    transition: 0.15s;
}
.filter-btn:hover {
    background: #e6eef1;
    color: #403de0;
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: #fafafa;
    border-color: var(--primary);
}

.search-box {
    flex: 1; /* ยืดเต็มพื้นที่ที่เหลือ */
    min-width: 0; /* ยอมให้หดได้ถ้าที่แคบมาก */
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: #f8fafc;
    font-size: 13px;
}
.search-box:focus {
    background: #fff;
    outline: none;
    border-color: var(--primary);
}

/* ================================
   Summary bar
================================ */
.summary-bar {
    background: #eff6ff;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    margin-bottom: 16px;
    font-size: 14px;
    color: #000000;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.badge-active, .badge-inactive {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-inactive { background: var(--danger-bg); color: var(--danger-text); }

/* ================================
   Position List
================================ */
.position-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.position-item {
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.position-item .pos-name { font-size: 15px; font-weight: 500; color: var(--text-main); }
.position-item .pos-count { color: var(--text-sub); font-size: 13px; margin-left: 12px; }

.btn-small-danger {
    background: #fff;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.1s;
}
.btn-small-danger:hover { background: #ef4444; color: white; }

/* ================================
   Table
================================ */
.table-responsive {
    overflow-x: auto; /* เลื่อนแนวนอนถ้าตารางล้นจอ */
    border-radius: 8px;
    border: 1px solid var(--border);
}

.empid-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px; /* ลด min-width ลงหน่อย */
}

.empid-table th, .empid-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    text-align: left;
}

.empid-table th { background-color: #f8fafc; color: var(--text-sub); font-weight: 500; }
.empid-table tbody tr { cursor: pointer; transition: 0.15s; }
.empid-table tbody tr:hover { background-color: #f1f5f9 !important; color: #000 !important; }

.btn-danger {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.btn-danger:hover { background: #ef4444; color: #fff; }

/* ================================
   🔥 Mobile Responsive Tweaks
   (ส่วนนี้แก้เรื่องปุ่มใหญ่/ตัวกรองซ้อน)
================================ */
@media (max-width: 768px) {
    /* ลด Padding ของ Card */
    .card {
        padding: 16px;
    }

    /* 1. Form Row (Input + Add Button) */
    .form-row {
        gap: 8px;
    }
    .form-row input {
        height: 40px; /* ลดความสูง */
        font-size: 14px;
    }
    .btn-primary {
        height: 40px; /* ลดความสูงให้เท่า input */
        padding: 0 16px; /* ลดความกว้างปุ่ม */
        font-size: 14px;
    }

    /* 2. Filter Row (หัวใจสำคัญ) */
    .filter-row {
        gap: 6px;
        /* ใช้ overflow-x auto ถ้าจอมันเล็กจัดๆ ให้เลื่อนปุ่มแนวนอนได้ แทนที่จะตบลงมาบรรทัด 2 */
        overflow-x: auto; 
        padding-bottom: 4px; /* เผื่อที่ให้ scrollbar นิดนึง */
    }
    
    /* ปุ่มกรองให้เล็กลง */
    .filter-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    /* Search box */
    .search-box {
        height: 34px; /* เล็กลง */
        font-size: 13px;
        min-width: 120px; /* บีบได้สุดๆแค่นี้ */
    }
    
    /* ปรับ Summary Bar */
    .summary-bar {
       
        align-items: flex-start;
        gap: 6px;
    }
}

/* ================================
   Modal & Profile Card (Style เดิมแต่เป็น Kanit)
================================ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: none; justify-content: center; align-items: center;
    padding: 20px; z-index: 2000; backdrop-filter: blur(3px);
}
.modal-overlay.show { display: flex; }

.modal-box {
    background: #fff; width: 100%; max-width: 360px;
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    animation: slideUp 0.2s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.profile-header-bg {
    height: 90px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    position: relative;
}
.profile-avatar {
    width: 70px; height: 70px;
    background: #fff; border: 4px solid #fff; border-radius: 50%;
    position: absolute; bottom: -35px; left: 50%; transform: translateX(-50%);
    display: flex; justify-content: center; align-items: center;
    font-size: 28px; font-weight: 600; color: var(--primary);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.profile-body { padding: 45px 20px 20px 20px; text-align: center; }
.profile-name { font-size: 25px; font-weight: 600; margin: 0; color: var(--text-main); }
.profile-position { font-size: 15px; color: var(--text-sub); margin-bottom: 16px; }

.detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    text-align: left; margin-bottom: 20px;
}
.detail-item { background: #f8fafc; padding: 10px; border-radius: 8px; }
.detail-label { font-size: 11px; color: #94a3b8; font-weight: 500; text-transform: uppercase; }
.detail-value { font-size: 13px; color: var(--text-main); font-weight: 500; }
.full-width { grid-column: span 2; }

.profile-empty { text-align: center; padding: 30px 20px; }
.profile-empty-icon { font-size: 40px; margin-bottom: 10px; opacity: 0.3; }

/* Modal Confirm Buttons */
.modal-actions { display: flex; justify-content: flex-end; gap: 18px; margin-top: 16px; }
.btn-secondary { background: #d8e3ee; color: var(--text-sub); border: none; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.btn-danger-confirm { background: #ef4444; color: white; border: none; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.modal-close-btn {
  margin-bottom: 20px;
  width: 80px;
}
/* 🔥 INPUT EDIT MODE */
.edit-input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1.5px solid #c7d2fe;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-main);
    background: white;
    outline: none;
    transition: 0.15s ease;
}

.edit-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}


/* ACTION BAR */
.modal-actions {
    display: flex;
    gap: 10px;
    align-content: center;
    padding: 14px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    bottom: 0;
    border-radius: 0 0 20px 20px;
}

/* ปุ่มทุกตัว */
.modal-actions button {
    flex: 1;
    height: 42px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 0px 0px;
    border: none;
    transition: all 0.15s ease;
}
.btn-edit {
    background: #f3f4f6;
    color: var(--text-main);
    border: none;
    box-shadow: #00000020 2px 2px 1px 0px;
    padding: 0px 0;
    border-radius: 8px;

    font-size: 14px;
    font-weight: 500;
}

.btn-save {
    background: #f3f4f6;
    color: var(--text-main);
    border: none;
    box-shadow: #00000020 2px 2px 1px 0px;
    padding: 0px 0;
    border-radius: 8px;

    font-size: 14px;
    font-weight: 500;
}
.btn-save:hover {
    background: #34d399;
    color: #ffffff;
}

.btn-edit:hover {
    background: #5abcf4;
    color: #ffffff;
}
.btn-close {
    background: #ffb3b3;
    color: #ffffff;
    margin-right: 0px;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: #00000020 2px 2px 1px 0px;
    cursor: pointer;
}

.btn-close:hover {
    background: #ff4d4d;
    color: #ffffff;
}

.toast {
    position: fixed;
    /*bottom: 160px;          ✅ ไปอยู่ล่างกลางจอ  */
    top: 10%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    min-width: 120px;
    max-width: 80vw;

    padding: 22px 22px;
    font-size: 16px;       /* ✅ ตัวใหญ่ขึ้น */
    font-weight: 700;
    text-align: center;
    border-radius: 10px;
    background: #222;
    color: rgb(250, 251, 255);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    white-space: pre-wrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;

    z-index: 99999;        /* ✅ โผล่บนทุกอย่าง */
}

/* ตอนโชว์ */
.toast.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* สีตามประเภท */
.toast.success {
    border: 2px solid #006ee3;
    background: linear-gradient(135deg, #fefffd, #d5fdff);
    color: #0077ff;
}

.toast.error {
    border: 2px solid #fbfffc;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}
/* หรับคำเตือนออก */
.toast.warning {
    /* คุณสามารถปรับแต่งสีและรูปแบบได้ตามต้องการ */
    border: 2px solid #ff7207; /* ขอบสีเหลืองทอง */
    background: linear-gradient(135deg, #f4feff, #e9f9ff); /* ไล่โทนสีเหลืองอ่อน */
    color: #4d1c04; /* ตัวอักษรสีน้ำตาลเข้ม */
    box-shadow: 0 6px 20px rgba(44, 44, 44, 0.4); /* เพิ่มเงาสีเหลือง */
    
}


.pin-box {
    background: #f1f5f9;
    border: none;
    padding: 4px;
    font-size: 0.9em;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.15s ease;
}
.pin-toggle {
    background: transparent;
    border: none;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.15s ease;
}

.edit-pin {
    background: #f1f5f9;
    border: none;
    padding: 4px;
    font-size: 0.9em;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.15s ease;
}
.detail-label2 {
    font-size: 11px;
    color: #ff0000;
    font-weight: 600;
    padding-top: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.pin-toggle:hover {
    opacity: 1;
    background: #e0e7ff;
}

.pin-toggle span {
    font-size: 16px;
    line-height: 1;
}
/* บังคับให้ช่อง PIN เหมือน detail-item อื่น */
.detail-item .pin-box ,
.detail-item .view-pin,
.detail-item .edit-pin {
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between !important;
}
.detail-item .pin-box {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
}
/* ทำให้ svg ใช้สีเดียวกับ text */
.pin-toggle {
    color: #334155;   /* สีเทาดำที่มองเห็นชัด */
}

/* hover เอฟเฟกต์ */
.pin-toggle:hover {
    color: var(--primary);
}

/* หาก`detail-item` พื้นหลังสว่างมาก */
.detail-item .pin-toggle {
    color: #1e293b;
}
.emp-branch {

    padding: 1px 0px;
  
    color: #8d8baa;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
  
.emp-name {
  font-weight: 700; 
  color: #2b00a0;
}

.emp-id {
    font-weight: 600;
    color: #009c1a;
    font-size: 14px;
    margin-bottom: 5px;
}

/*จัดการลาออก*/

/* =================================== */
/* GLOBAL FORM STYLES (สำหรับฟอร์มทั่วไปใน Modal) */
/* =================================== */

/* กำหนดสไตล์พื้นฐานของ Input/Select/Textarea */
#exitModal input[type="date"], 
#exitModal select, 
#exitModal textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px; /* เว้นระยะห่างจาก Label */
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box; /* ทำให้ Padding ไม่ขยายความกว้างของ Box เกิน 100% */
    font-size: 14px;
    font-family: inherit; /* ใช้ font เดียวกันกับหน้าเว็บ */
}

/* สไตล์เมื่อ Focus (เวลาคลิกช่อง) */
#exitModal input[type="date"]:focus,
#exitModal select:focus,
#exitModal textarea:focus {
    border-color: #3b82f6; /* สีน้ำเงินสว่าง */
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* สำหรับ Textarea ให้ปรับความสูงได้ */
#exitModal textarea {
    resize: vertical;
    min-height: 80px;
}

/* จัดกลุ่ม Form แต่ละส่วน */
#exitModal .form-group {
    margin-bottom: 15px; /* เว้นระยะห่างระหว่างฟอร์มแต่ละตัว */
}

/* สไตล์ Label */
#exitModal label {
    display: block; /* ทำให้ Label อยู่บน Input */
    font-weight: 600; /* ตัวหนาเล็กน้อย */
    font-size: 14px;
    color: #333;
}


/* =================================== */
/* MODAL LAYOUT & BUTTONS */
/* =================================== */

/* Exit Modal Container (Overlay) */
#exitModal {
    position: fixed;
    inset: 0; 
    z-index: 9999;
    display: none; 
    background: rgba(0, 0, 0, 0.5); 
    justify-content: center;
    align-items: center;
}

/* State: When the modal is active */
#exitModal.show {
    display: flex; 
}

/* Inner Modal Box Content */
#exitModal .modal-box {
    width: 380px; /* ขยายความกว้างขึ้นเล็กน้อยเพื่อความโปร่งตา */
    max-width: 90%;
    background: #fff;
    border-radius: 12px;
    padding: 25px; /* เพิ่ม Padding ให้เยอะขึ้น */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* เพิ่มเงาให้น่าสนใจ */
    animation: pop 0.2s ease;
}

/* Header/Title */
#exitModal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em; /* ทำให้หัวข้อใหญ่ขึ้น */
    color: #001a3e;
    border-bottom: 1px solid #eee; /* เส้นแบ่งหัวข้อกับฟอร์ม */
    padding-bottom: 10px;
}

/* Button Group (กลุ่มปุ่ม ยกเลิก/บันทึก) */
/* เนื่องจากคุณใช้ style="text-align:right;" บน HTML, ฉันจะปรับปรุงให้ใช้ CSS แทน */
#exitModal .modal-box > div:last-child {
    text-align: right;
    margin-top: 20px; /* เว้นระยะห่างจากฟอร์มด้านบน */
    display: flex;
    justify-content: flex-end; /* จัดปุ่มไปทางขวา */
    gap: 10px; /* ระยะห่างระหว่างปุ่ม */
}

/* ปุ่มทั่วไป (เช่น "ยกเลิก") */
#exitModal button {
    /* รีเซ็ตสไตล์เบื้องต้น */
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    
    /* สไตล์เฉพาะปุ่มยกเลิก */
    background: #c4d7ff; /* สีเทาอ่อน */
    color: #374151; /* สีตัวอักษรเทาเข้ม */
}

/* Hover effect */
#exitModal button:hover {
    background: #d1d5db;
}

/* ปุ่มหลัก (Warning) */
.btn-warningx {
    /* เพิ่มเติมจากโค้ดเดิมของคุณ */
    background: #f8cec5 !important;
    color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); 
}

/* Hover effect สำหรับปุ่ม Warning */
.btn-warning:hover {
    background: #f59e0b; /* สีเข้มขึ้นเมื่อเมาส์ชี้ */
}

/* Keyframes for Pop Animation */
@keyframes pop {
    from { 
        transform: scale(0.95); /* ปรับให้ pop น้อยลง */
        opacity: 0; 
    }
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}
/*จะออก*/
.btn-warning {
    background: #ffb300;
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    margin-right: 6px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: #00000020 2px 2px 1px 0px;
    cursor: pointer;
}
.btn-warning:hover {
    background: #ef9a2a;
    color: #ffffff;
    box-shadow: #00000040 2px 2px 5px 0px;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: bold;
}

.badge.resigning {
    background: rgb(240, 121, 97);
    color: #f7f7f7;
}
/*ออกแล้ว*/
.exit-panel {
    margin: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #fff8eb;
    border-left: 4px solid orange;
    font-size: 14px;
}

.exit-title {
    font-size: 1.0em;
    font-weight: 700;
}

.row-resigning {
    background: #fffbee;
}

.badge.left {
    background: #bd7676;
    color: #ffffff;
}

.row-left {
    opacity: 0.4;
}

.exit-panel.left {
    background: #fff5f4;
    border-left-color: #e78282;
    color: #b71c1c;
}


/* ===== EXPORT MODAL ===== */

.btn-export {
    display: flex;
    align-content: center;
    gap: 5px;
    border-bottom: 3px solid #5db068;
    color: #059200;
    background: rgb(255, 255, 255);
    padding: 8px 16px;
    margin-bottom: 10px;
    border-radius: 20px;
    box-shadow: #1e293b33 0px 2px 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-export:hover {
    background: #56c977;
    border-bottom: 2px solid #509c5a;
    color: white;
    box-shadow: 0 2px 4px rgba(8, 11, 16, 0.35);
}

/* =================================== */
/* 1. MODAL LAYOUT & BOX STYLES */
/* =================================== */

/* Modal Container (Overlay) - สมมติว่ามีการกำหนด display: flex; ไว้ที่ overlay */
.modal-overlay { 
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Modal Box - กล่องหลัก */
#exportModal .modal-box {
    width: 380px; /* กำหนดความกว้างที่เหมาะสม */
    max-width: 90%;
    padding: 25px; 
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* เงาสวยงาม */
    animation: zoomIn 0.25s ease;
}

/* Title */
#exportModal h3 {
    font-size: 1.35em; 
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 20px; 
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb; /* เส้นแบ่งที่บางลง */
}

/* =================================== */
/* 2. FORM INPUTS (ชื่อไฟล์) */
/* =================================== */

/* Label ด้านบน Input */
/* *** ต้องเพิ่ม class="form-label" ให้ label ใน HTML *** */
#exportModal .form-label { 
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

/* Input Text */
#exportModal input[type="text"] {
    width: 100%;
    padding: 10px; 
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 20px; 
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

#exportModal input[type="text"]:focus {
    border-color: #2563eb; /* สีน้ำเงินเข้ม */
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* =================================== */
/* 3. CHECKBOX LIST (แก้ปัญหาเปลืองพื้นที่) */
/* =================================== */

/* CONTAINER สำหรับ Checkbox ทั้งหมด *** ต้องเพิ่ม class="checkbox-group" ใน HTML *** */
.checkbox-group {
    /* ใช้ CSS Grid เพื่อจัดเรียงเป็น 2 คอลัมน์ */
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 คอลัมน์ขนาดเท่ากัน */
    gap: 12px 20px; /* ระยะห่างระหว่างรายการ */
    margin-bottom: 15px;
    padding-left: 5px; /* เว้นระยะจากขอบซ้ายเล็กน้อย */
}

/* สไตล์ของแต่ละ Label (Checkbox) */
#exportModal .checkbox-group label {
    display: flex; /* จัดเรียง Input/Text ใน Label */
    align-items: center; 
    cursor: pointer;
    font-size: 14px;
    margin: 0; 
    color: #374151;
}

/* สไตล์ Checkbox ตัว Input */
#exportModal input[type="checkbox"] {
    accent-color: #10b981; /* สีเขียวมิ้นท์ที่ดูดีขึ้น */
    margin-right: 8px; 
    width: 16px;
    height: 16px;
}

/* =================================== */
/* 4. BUTTONS & ACTIONS */
/* =================================== */

#exportModal .modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px; /* เพิ่มระยะห่างจาก Checkbox */
    gap: 10px;
}

#exportModal button {
    border: none;
    padding: 9px 16px; 
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px; 
    transition: background-color 0.15s, box-shadow 0.15s;
}

/* Cancel Button */
#exportModal button:not(.btn-export-confirm) {
    background: #e5e7eb;
    color: #374151;
}
#exportModal button:not(.btn-export-confirm):hover {
    background: #d1d5db;
}

/* Export Button (หลัก) */
#exportModal .btn-export-confirm {
    background: #10b981; /* สีเขียวเดียวกับ Checkbox */
    color: #fff;
    font-weight: 600; 
    box-shadow: 0 1px 3px 0 rgba(16, 185, 129, 0.3);
}

#exportModal .btn-export-confirm:hover {
    background: #059669; /* เข้มขึ้นเมื่อ Hover */
}

/* Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}