/* Container ของตาราง: เพิ่มเงาและขอบมน */
.modern-grid-view {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* เงาแบบนุ่มๆ */
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #f1f3f5;
}

/* ลบเส้นขอบตารางแบบเดิมออก */
.modern-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* สไตล์ของหัวตาราง (Header) */
.modern-table thead th {
    background-color: #10b981;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 2px solid #e9ecef !important;
    border-top: none !important;
}

/* ทำให้ขอบหัวตารางซ้ายขวามนเข้ากับ Container */
.modern-table thead th:first-child {
    border-top-left-radius: 8px;
}

.modern-table thead th:last-child {
    border-top-right-radius: 8px;
}

/* สไตล์ของเซลล์ข้อมูล */
.modern-table tbody td {
    padding: 16px;
    color: #333333;
    font-size: 14px;
    border-bottom: 1px solid #f1f3f5;
    /* เส้นแบ่งแถวแบบบางๆ */
    transition: background-color 0.2s ease;
    /* อนิเมชั่นตอน Hover */
}

/* Hover Effect: เปลี่ยนสีพื้นหลังเวลานำเมาส์ไปวาง */
.modern-table tbody tr:hover td {
    background-color: #f1f8ff;
    /* สีฟ้าอ่อนๆ เวลากด */
}

/* แถวสุดท้ายไม่ต้องมีเส้นใต้ */
.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* ตกแต่งปุ่มลงทะเบียนให้ดูทันสมัย */
.btn-modern {
    border-radius: 8px;
    padding: 6px 16px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
    transition: all 0.2s;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* ตกแต่ง Pagination ของ Yii2 ให้เข้ากับธีม */
.modern-grid-view .pagination>li>a,
.modern-grid-view .pagination>li>span {
    border-radius: 5px;
    margin: 0 3px;
    color: #495057;
    border: 1px solid #e9ecef;
}

.modern-grid-view .pagination>.active>a {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}



/* ฟอร์มบันทึกข้อมูล */
/* Container พื้นหลังฟอร์ม */
.modern-form-container {
    padding: 20px 15px;
    display: flex;
    justify-content: center;
}

/* กล่องการ์ดสีขาว */
.form-card {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f5;
}

/* หัวข้อฟอร์ม */
.form-title {
    color: #2b3445;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.form-divider {
    border-top: 2px solid #e9ecef;
    width: 60px;
    margin: 0 auto 30px auto;
}

/* ตกแต่ง Label ให้ดูเป็นระเบียบ */
.form-card label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

/* ตกแต่ง Input Fields */
.form-card .form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: none;
}

/* เอฟเฟกต์เวลาคลิกที่ช่อง Input */
.form-card .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

/* ปรับแต่ง Select2 ให้เข้ากับ Input ปกติ */
.form-card .select2-container--krajee-bs3 .select2-selection,
.form-card .select2-container--bootstrap4 .select2-selection,
.form-card .select2-container--default .select2-selection--single {
    border-radius: 8px !important;
    height: 44px !important;
    border: 1px solid #ced4da !important;
    display: flex;
    align-items: center;
}

.form-card .select2-selection__arrow {
    height: 42px !important;
}

/* ตกแต่งปุ่ม Submit */
.btn-modern-submit {
    background-color: #10b981;
    border-color: #10b981;
    border-radius: 8px;
    padding: 10px 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-modern-submit:hover {
    background-color: #059669;
    border-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

/* ตกแต่งปุ่ม Cancel */
.btn-modern-cancel {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #e9ecef;
    border-radius: 8px;
    padding: 10px 30px;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.btn-modern-cancel:hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
    color: #212529;
}

/* ระยะห่างของ Error Message (Help Block) ใน Yii2 */
.form-card .help-block {
    color: #ef4444;
    font-size: 12px;
    margin-top: 5px;
}

.form-card .has-error .form-control {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}