*{
    font-family: "Noto Sans Thai", sans-serif;

}
body {
    font-family: Arial, sans-serif;
    background: linear-gradient(#ff9292, #8e97ff);
    background-attachment: fixed;
    margin: 20px;
    display: flex;
    justify-content: center; /* จัดให้อยู่ตรงกลางแนวนอน */
    align-items: center; /* จัดให้อยู่ตรงกลางแนวตั้ง */
    height: 100vh; /* ทำให้เต็มจอ */
    margin: 0;
}
.form-control-40 {
    width: 40% !important; /* ใช้ !important เพื่อให้แน่ใจว่า class นี้จะถูกใช้งานก่อน */
}
.form-control-100 {
    width: 100% !important; /* ใช้ !important เพื่อให้แน่ใจว่า class นี้จะถูกใช้งานก่อน */
}
.container {
    width: 95%;
    margin: auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 8px 15px;
    margin-bottom: 10px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    padding-right: 10px;
}
.btn:hover {
    background-color: #0056b3;
}
h2 {
    padding: 0;
    margin: 0;
}


form {
    display: flex;
    flex-direction: column;
}

label {
    margin-top: 10px;
    font-weight: bold;
}
.left {
    display: flex;
    justify-content: flex-start; 
    align-items: left; 
    width: 100%; 
    text-align: left;
    gap: 10px;
    padding: 0;
}
.right {
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 0;
}
.center {
    display: flex;
    justify-content: center;
    align-items: center;  
    width: 100%;
    gap: 10px;
    padding: 0;
}
.center > form {
    width: 100%; /* สั่งให้ form ขยายเต็ม 100% */
    max-width: 600px; /* กำหนดความกว้างสูงสุดที่ต้องการ ไม่ให้กว้างเกินไปบนจอใหญ่ */
}

.btn.red {
    background-color: #ff0303;
    color:white;
}
.btn.red:hover {
    background-color: #ff3737;
    color:white;
}
.btn.green {
    background-color: #06a50e;
}
.btn.green:hover {
    background-color: #137400;
}
.btn.yellow {
    background-color: #ffbe0c;
}
.btn.yellow:hover {
    background-color: #fc8517;
}
.btn.blue {
    background-color: #0c7dff;
}
.btn.blue:hover {
    background-color: #00367c;
}
.btn.gray {
    background-color: #888888;
}
.btn.gray:hover {
    background-color: #525252;
}
.btn.purple {
    background-color: #ff80f9;
}
.btn.purple:hover {
    background-color: #9e006f;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    border: 1px solid #000;
    padding: 10px;
    text-align: center;
}
th {
    background-color: #f2f2f2;
}
.sum-row {
    font-weight: bold;
    background-color: #dff0d8;
}
.login-container {
    width: 350px;
    margin: 100px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

h2 {
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-color: #9c9c9c;
    border-radius: 5px;
    outline: none;
}

button {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #218838;
}

a {
    color: #0031ad;
    font-weight: bold;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.btn.logout {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: #dc3545;
    border-radius: 5px;
}

.btn.logout:hover {
    background-color: #c82333;
}
.btn.delete {
    background: #dc3545;
    font-size: 14px;

}

.btn.delete:hover {
    background: #b52a3b;
}
.action-buttons {
    display: flex;
    gap: 10px;
}
.btn.edit {
    background: #00ff55;
    color: white;
    font-size: 14px;

}

.btn.edit:hover {
    background: #0baf21;
}
.btn.update {
    background: #0077ff;
    color: white;
    font-size: 14px;

}

.btn.update:hover {
    background: #0bafaf;
}
.text-left {
    text-align: left !important;
}
select {
    width: 50%;
    padding: 10px;
    border: 2px solid #007bff; /* เส้นขอบสีน้ำเงิน */
    border-radius: 5px;
    background-color: white;
    font-size: 16px;
    color: #333;
    appearance: none; /* ลบสไตล์เริ่มต้นของ browser */
    cursor: pointer;
    transition: all 0.3s ease;
}

/* เพิ่มไอคอนลูกศร */
select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23007bff"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 35px; /* เว้นที่ให้ไอคอน */
}

/* เมื่อ hover หรือ focus */
select:hover, select:focus {
    border-color: #0056b3; /* เปลี่ยนสีขอบ */
    box-shadow: 0px 0px 5px rgba(0, 123, 255, 0.5);
    outline: none;
}
label{
    font-size: 18px;
    color:#0077ff;
}
.box-container {
    width: 60%; /* กว้างขึ้นนิดหน่อย */
    max-height: 700px; /* จำกัดความสูง */
    overflow-y: auto;  /* ถ้าข้อมูลเยอะเลื่อนในกล่อง */
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

/* จัดตารางให้เต็มความกว้าง */
.box-container table {
    width: 100%;
    border-collapse: collapse;
}

/* ทำให้หัวตารางอยู่กับที่ */
.box-container thead th {
    position: sticky;
    top: 0;
    background: #f2f2f2; /* พื้นหลังหัวตาราง */
    z-index: 2;
}

.box-container select {
    width: 25%;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23007bff"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 35px; /* เว้นที่ให้ไอคอน */
}
.box-container input {
    width: 40%;
}
.box-container label {
    text-align: left;
}
.form-group {
    display: flex;
    align-items: center;  /* จัดให้อยู่ตรงกลาง */
    gap: 0px;  /* เว้นระยะห่างระหว่าง label และ input */
    margin-bottom: 10px; /* เพิ่มระยะห่างแต่ละบรรทัด */
}

.form-group label {
    width: 200px; /* ปรับขนาด label */
    text-align: left; /* จัดข้อความชิดขวา */
    font-weight: bold;
}

.form-group input {
    width: 40%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #007bff; /* เส้นขอบสีน้ำเงิน */
}
.button-group {
    text-align:center;

}
.box-container button {
    width: 25%;
    background-color:rgb(5, 134, 26);
    border-radius: 10px;
    gap: 10px;  
}
.box-container button:hover {
    background-color:rgb(0, 160, 27);
}
.form-group-index {
    display: flex;
    align-items: center;  /* จัดให้อยู่ตรงกลาง */
    gap: 0px;  /* เว้นระยะห่างระหว่าง label และ input */
    margin-bottom: 10px; /* เพิ่มระยะห่างแต่ละบรรทัด */
}
.form-group-index label {
    width: 220px; /* ปรับขนาด label */
    text-align: left; /* จัดข้อความชิดขวา */
    font-weight: bold;
    font-size: 24px;
}
.form-group-index select {
    width: 40%;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23007bff"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 35px; /* เว้นที่ให้ไอคอน */
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}
.text-left {
    text-align: left;
    padding-left: 10px;
}
.text-right {
    text-align: right;
    padding-right: 10px;
}
.text-center {
    text-align: center;
}