input:-webkit-autofill,
select:-webkit-autofill, /* Added */
input:-webkit-autofill:hover,
select:-webkit-autofill:hover, /* Added */
input:-webkit-autofill:focus,
select:-webkit-autofill:focus, /* Added */
input:-webkit-autofill:active,
select:-webkit-autofill:active {
    /* Change the text color */
    -webkit-text-fill-color: #5e5d5d !important;
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

 input:focus {
    outline: none; /* This removes the default black/blue outline */
    border-color: #80bdff; /* Optional: Change the border color to match your theme */
    box-shadow:none; /* Add a soft blue glow */
}

 /* 1. Sets the default text color for both inputs and selected values */
    input.form-control,
    select.form-control {
        color: #5a6168 !important; /* Your desired text color */
    }
    .form-control::placeholder {
    color: #cccbcb; /* Your desired light grey color */
    opacity: 1; /* Firefox adds a lower opacity by default, so we reset it */
}

    /* 2. Overrides the color when the select placeholder is shown */
    select.form-control:invalid {
        color: #999; /* A lighter color for the placeholder */
    }

    /* 3. Sets the color for items in the opened dropdown list */
    select.form-control option {
        color: #333; /* Standard dark color for readability */
    }

    .form-control:disabled {
    background-color: var(--tg-white);
     -webkit-text-fill-color: #949090 !important;
    opacity: 1;
    cursor:not-allowed;
}


.statusUpdate {
    border: 1px solid white;
    border-radius: 5px;
    margin:20px 0;
}

   /* เพิ่ม border เมื่อ checkbox ถูกเลือก */
   .statusUpdate:has(input[type="checkbox"]:checked) {
    border: 1px solid var(--tg-primary-300);
    padding: 10px;
}

/* ซ่อน section เมื่อ checkbox ไม่ถูกเลือก */
.statusUpdate:not(:has(input[type="checkbox"]:checked)) .show-box {
    display: none;
}

/* แสดง section เมื่อ checkbox ถูกเลือก */
.statusUpdate:has(input[type="checkbox"]:checked) .show-box {
    display: grid;
}




.statusUpdate .t-center:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left-color: #0056b3;
}

/* หรือสไตล์แบบ Gradient */
.statusUpdate .t-center {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: #fff;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 25px;
    margin: 0 0 15px 0;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.statusUpdate .t-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}



/* สไตล์สำหรับ checkbox ในหัวข้อ */
.statusUpdate .t-center input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #fff;
    cursor: pointer;
    transform: scale(1.2);
}


.update-status-job {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;

}
.update-status-job .update-cancel ,.update-status-job .update-approve {
    background-color:rgb(240, 240, 240);
    border: 1px solid rgb(240, 240, 240);
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}
/* ใช้ :has() เพื่อเปลี่ยนสี container เมื่อมี radio ถูกเลือก */
.update-cancel:has(input[type="radio"]:checked) {
    background-color: rgb(252, 212, 212) !important;
    border: 1px solid #dc3545;
}
.update-approve:has(input[type="radio"]:checked) {
    background-color:rgb(205, 248, 245) !important;
    border: 1px solid rgb(43, 141, 134);
}

.dc {
    display: flex;
    gap: 10px;
}
.dc .tg-detail-pill span {
    white-space: nowrap;
}

/* CSS สำหรับ tg-detail-pill */
.tg-detail-pill {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    padding: 5px 10px;
    background-color:white !important;
    border: 1px solid #e5e7eb;
}
.tg-detail-pill:hover {
    background-color: rgba(0, 0, 0, 0.1);

}

/* เปลี่ยนสี text เมื่อ radio ถูกเลือก */
.tg-detail-pill input[type="radio"]:checked + span {
    /* font-weight: bold; */
    color: #007bff;
}

/* เปลี่ยนสี background ของ tg-detail-pill เมื่อ radio ถูกเลือก */
.tg-detail-pill:has(input[type="radio"]:checked) {
    background-color: #e3f2fd;
    border: 1px solid #007bff;
}


/* radio */
.tg-radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tg-radio-option input[type="radio"] {
    accent-color: var(--tg-primary);
    width: 18px;
    height: 18px;
}
.tg-radio-option label {
    font-weight: 500;
}

/* --- Custom Styles for Select2 --- */

        /* Change the border and background of the main container */
        .tg-form-group .select2-container--default .select2-selection--single {
            /* background-color:transparent !important; */
            border: 1px solid transparent !important;
            border-radius: 8px;
            height: 35px !important;


        }

         .select2-container--default .select2-selection--single {
            /* background-color:transparent !important; */
            border: 1px solid rgb(226, 227, 228) !important;
            border-radius: 6px !important;
            height: 39px !important;
            vertical-align: middle !important;


        }


        /* Style the text of the selected item */
        .select2-container--default .select2-selection--single .select2-selection__rendered {
            color: #5a6168 !important;
            line-height: 35px !important;
            padding-right: 20px !important;
        }

        .select2-container--default .select2-selection--single .select2-selection__arrow {
            height: 38px !important;
        }
        /* Style the dropdown arrow */
        .select2-container--default .select2-selection--single .select2-selection__arrow b {
            border-color: #007bff transparent transparent transparent;
            color:rgb(230, 224, 224) !important;
            top:45% !important;
        }



        /* select2 */
        .select2-dropdown {
            background-color: var(--tg-sky-100) !important;
            border: 1px solid  var(--tg-sky) !important;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            margin-top:0.3rem;
            overflow: hidden;
            border-radius: 5px !important;
        }

        .select2-search__field {
            border-radius: 5px !important;
            /* border:none !important; */
            border:1px solid var(--tg-sky) !important;
        }

        /* Style the highlighted option on hover */
        .select2-container--default .select2-results__option--highlighted[aria-selected] {
            background-color: var(--tg-accent) !important;/* Blue background on hover */
            color: white;
        }

        /* Target the scrollable results list within Select2 */
            .select2-results__options::-webkit-scrollbar {
                width: 2px; /* Width of the scrollbar */
            }

            /* Style the track (the background of the scrollbar) */
            .select2-results__options::-webkit-scrollbar-track {
                background: #f1f1f1; /* Light grey track */
            }

            /* Style the thumb (the draggable part of the scrollbar) */
            .select2-results__options::-webkit-scrollbar-thumb {
                background:  var(--tg-grey-100) !important;/* Darker grey thumb */
                border-radius: 4px; /* Rounded corners for the thumb */
            }

            /* Optional: Style the thumb on hover */
            .select2-results__options::-webkit-scrollbar-thumb:hover {
                background: #555; /* Darken thumb on hover */
            }


            /* --- Components: Forms & Buttons --- */
.tg-form-control {
    border-radius: 5px;
    border: 1px solid var(--tg-grey);
    display: block;
    height: 40px;
    padding: 10px;
    transition: all 0.3s ease;
    font-size: var( --fs-sm);
}

.tg-form-control:hover {
    border-color: var(--tg-secondary);
    box-shadow: 0 0 5px rgba(102, 177, 184, 0.5);
    transform: translateY(-1px);
}

.tg-form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(99, 180, 182, 0.25);
    outline: none;
}

.tg-form-control.tg-lg {
    height: 41px;
    font-size: var( --fs-md);
    width: 300px;
    min-width: 100%;
}

.tg-form-label {
    color: var(--tg-text);
    margin-bottom: 3px;
    font-size: var( --fs-sm);
    font-weight: var(--font-weight-medium);
}

 .tg-form-group { 
    height:max-content;
    display: flex; 
    flex-direction: column; 
    border:1px solid var(--tg-grey); 
    padding:0px;padding-top:5px;
    position: relative;
    margin-top:10px;
    background: white;
    border-radius:7px;
}
.tg-form-group label,.tg-form-group p {
    border-radius:7px;
    color:var(--tg-grey-600); 
    margin-bottom: 0rem;
    font-weight: 500; position:
    absolute;
    align-content:
    center;top:-12px;
    z-index:5;background: rgb(255, 255, 255);
    left:10px;font-size: 14px;
    padding:0px 3px;
}
.tg-form-group label span {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tg-form-group label i  {
    margin:5px;

}


.tg-form-group.tb label {
color:var(--tg-primary);

}

.tg-form-group.tb  {
color: #5a6168 !important;
min-width: 120px;
height: 40px;

}


.tg-form-group.tb .inner {
height: 100%;
display: flex;
justify-content: space-between;
padding:0px 7px;
align-items: center;
}

.tg-form-group.tb .inner  span{
text-align: center;
width: 100;
}




.tg-form-group.tb .dropdown-toggle::after {
    color: #aaa;
    font-size: 20px;

}
.custom-search-wrapper .bi-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.tg-form-group .form-control ,.tg-form-group .form-select{
border:none;
}
.tg-form-group .form-control:focus ,.tg-form-group .form-control:active{
    box-shadow: none;
}
.tg-form-group .form-select:focus ,.tg-form-group .form-select:active{
    box-shadow: none;
}
        .radio-group { display: flex; gap: 1.5rem; margin: 1rem 0; }
        .radio-item { display: flex; align-items: center; gap: 0.5rem; }
        .address-block { background-color: #e6f4f1; padding: 1.5rem; border-radius: 8px; }


.tg-form-group.grey p ,.tg-form-group.grey label{
    color:var(--tg-grey-500);
}


