/* =======================
   HR Service Template (Royal Elegant Theme)
   Author: University of Phayao HR Service Portal
======================= */

/* ✅ ใช้เฉพาะเมื่อแสดงผลบนหน้าจอเท่านั้น */
@media screen {

    /* -------- Global Layout -------- */
    html, body {
        font-family: 'Kanit', sans-serif;
        background: #f9fafb;
        color: #2f2f2f;
        margin: 0;
        padding: 0;
        height: 100%;
    }
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    main {
        flex: 1;
        background: transparent;
    }

    /* -------- Header -------- */
    .top-header {
        background: linear-gradient(90deg, #1a1f33, #2c3e50, #b8860b);
        color: #fff;
        padding: 20px 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    }
    .top-header .logo {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    .top-header .logo img {
        height: 60px;
        width: auto;
        border-radius: 8px;
    }
    .top-header .logo h1 {
        font-size: 26px;
        font-weight: 500;
        letter-spacing: 0.5px;
    }
    .top-header .university {
        font-size: 15px;
        font-weight: 300;
        color: #f0e6c8;
    }

    /* -------- Navbar -------- */
    .menu-bar {
        background: #ffffff;
        border-bottom: 1px solid #ddd;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    }
    .menu-bar ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
    .menu-bar li { margin: 0; }
    .menu-bar a {
        display: block;
        padding: 14px 28px;
        color: #3b3b3b;
        font-weight: 400;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    .menu-bar a:hover {
        background: #f7f2e8;
        color: #b8860b;
    }
    .menu-bar a.active {
        background: linear-gradient(to right, #b8860b, #9c7d2b);
        color: white;
        border-radius: 0 0 6px 6px;
        box-shadow: inset 0 -2px 8px rgba(0, 0, 0, 0.08);
    }

    /* -------- Main Content -------- */
    main.content {
        text-align: center;
        padding: 80px 20px;
    }
    main .welcome h2 {
        font-size: 32px;
        color: #2c3e50;
        font-weight: 500;
    }
    main .welcome p {
        font-size: 17px;
        margin-top: 10px;
        color: #555;
        line-height: 1.8;
    }
    .main-btn {
        display: inline-block;
        background: linear-gradient(to right, #b8860b, #9c7d2b);
        color: white;
        padding: 12px 32px;
        border-radius: 8px;
        font-size: 16px;
        margin-top: 25px;
        transition: 0.3s;
    }
    .main-btn:hover {
        background: linear-gradient(to right, #8b7500, #745e1f);
        transform: translateY(-2px);
    }

    /* -------- Table -------- */
    table {
        border-collapse: collapse;
        width: 95%;
        margin: 30px auto 60px;
        background: #ffffff;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    }
    th, td {
        padding: 12px 16px;
        border-bottom: 1px solid #eee;
        text-align: center;
        font-size: 15px;
    }
    th {
        background: linear-gradient(to right, #faf7f2, #f3f0e8);
        font-weight: 500;
        color: #2c3e50;
    }
    tr:nth-child(even) { background: #fafafa; }
    tr:hover { background: #fff7e6; transition: 0.3s; }

    /* -------- Buttons -------- */
    .edit-btn {
        background: linear-gradient(to right, #b8860b, #9c7d2b);
        border: none;
        color: white;
        padding: 6px 14px;
        border-radius: 6px;
        cursor: pointer;
        transition: 0.2s;
        font-size: 14px;
    }
    .edit-btn:hover {
        background: linear-gradient(to right, #8b7500, #745e1f);
        transform: scale(1.05);
    }

    /* -------- Modal -------- */
    .modal {
        display: none;
        position: fixed;
        z-index: 999;
        padding-top: 80px;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0,0,0,0.4);
    }
    .modal-content {
        background-color: #fff;
        margin: auto;
        padding: 25px 30px;
        border: 1px solid #ddd;
        width: 400px;
        border-radius: 14px;
        box-shadow: 0 6px 25px rgba(0,0,0,0.15);
        animation: fadeIn 0.3s ease;
    }
    .modal-content h3 {
        color: #b8860b;
        text-align: center;
        margin-bottom: 15px;
    }
    .modal-content label {
        display: block;
        margin: 8px 0 4px;
        color: #333;
        font-weight: 400;
    }
    .modal-content input[type="text"],
    .modal-content input[type="number"],
    .modal-content input[type="file"] {
        width: 100%;
        padding: 8px;
        margin-bottom: 10px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-family: 'Kanit', sans-serif;
    }
    .modal-content input[type="submit"] {
        width: 100%;
        background: linear-gradient(to right, #b8860b, #9c7d2b);
        color: white;
        border: none;
        padding: 10px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 16px;
        transition: 0.3s;
    }
    .modal-content input[type="submit"]:hover {
        background: linear-gradient(to right, #8b7500, #745e1f);
        transform: translateY(-2px);
    }
    .close {
        color: #888;
        float: right;
        font-size: 22px;
        font-weight: bold;
        cursor: pointer;
    }
    .close:hover { color: #b8860b; }

    @keyframes fadeIn {
        from {opacity: 0; transform: translateY(-20px);}
        to {opacity: 1; transform: translateY(0);}
    }

    /* -------- Success Message -------- */
    .success {
        color: #2e7d32;
        text-align: center;
        font-size: 16px;
        background: #f2f8f2;
        border: 1px solid #c8e6c9;
        border-radius: 8px;
        padding: 10px;
        width: fit-content;
        margin: 10px auto;
    }

    /* -------- Search Form -------- */
    .search-form input[type="text"],
    .search-form input[type="date"] {
        border: 1px solid #ccc;
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 15px;
        transition: 0.3s;
    }
    .search-form input:focus {
        border-color: #b8860b;
        box-shadow: 0 0 5px rgba(184,134,11,0.4);
        outline: none;
    }
    .search-form button {
        background: linear-gradient(to right, #b8860b, #9c7d2b);
        color: white;
        border: none;
        border-radius: 8px;
        padding: 8px 16px;
        cursor: pointer;
        font-size: 15px;
        transition: 0.3s;
    }
    .search-form button:hover {
        background: #8b7500;
    }

    /* -------- Dashboard Summary -------- */
    .dashboard-grid .summary-box {
        border-top: 4px solid #b8860b;
    }

    /* -------- Pagination -------- */
    .pagination a {
      background: #f7f2e8;
      color: #8b7500;
    }
    .pagination a:hover {
      background: #b8860b;
      color: #fff;
    }
    .pagination a.active {
      background: linear-gradient(to right, #b8860b, #9c7d2b);
      color: #fff;
    }

    /* -------- Submenu -------- */
    .menu-bar ul li.has-submenu .submenu {
      background: #fffdf7;
      box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    }
    .menu-bar ul li.has-submenu .submenu li a:hover {
      background-color: #fff5e0;
      color: #b8860b;
      transform: translateX(4px);
    }
}

/* -------- Print -------- */
@media print {
    @page {
        size: A4 landscape;
        margin: 1.2cm;
    }
    header, nav, .navbar, form { display: none !important; }
    html {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body, table, td, th, p, h1, h2, h3, h4, h5, h6 {
        font-family: 'TH Niramit AS', sans-serif !important;
    }
}
/* -------- Navbar (Elegant Gold Theme) -------- */
.menu-bar {
  position: relative;
  background: #ffffff;
  border-bottom: 1px solid #e5e8ec;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 99;
}

.menu-bar ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.menu-bar li {
  position: relative;
}

.menu-bar a {
  display: flex;

  padding: 14px 26px;
  color: #2c3e50;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 6px 6px 0 0;
}

.menu-bar a:hover {
  background: #fff8e1;
  color: #b8860b;
}

.menu-bar a.active {
  background: linear-gradient(90deg, #b8860b, #9c7d2b);
  color: #fff;
  box-shadow: inset 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* -------- Submenu (Fixed dropdown overlap issue) -------- */
.menu-bar ul li.has-submenu {
  position: relative;
}

.menu-bar ul li.has-submenu .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fffefb;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  list-style: none;
  padding: 8px 0;
  min-width: 220px;
  z-index: 9999;
  animation: fadeIn 0.25s ease-in-out;
}

.menu-bar ul li.has-submenu:hover .submenu {
  display: block;
}

.menu-bar ul li.has-submenu .submenu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  color: #2f2f2f;
  background: transparent;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.25s ease-in-out;
}

.menu-bar ul li.has-submenu .submenu li a:hover {
  background-color: #fff4d6;
  color: #b8860b;
  transform: translateX(4px);
}

/* เพิ่ม margin ให้ submenu แยกจากเมนูหลักนิดหนึ่ง */
.menu-bar ul li.has-submenu:hover .submenu {
  margin-top: 2px;
}

/* -------- Fix overlapping shadow on multiple rows -------- */
.menu-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(184,134,11,0.3), rgba(255,255,255,0));
  z-index: -1;
}

/* -------- Animation -------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* =============================
   HR PORTAL LOGIN PAGE (ELEGANT THEME)
   ============================= */
/* =============================
/* =============================
   HR PORTAL LOGIN PAGE (STABLE CLEAN VERSION)
   ============================= */

/* ใช้เฉพาะเมื่อหน้า login มี class="content login-page" */
main.content.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  min-height: 75vh;
  background: linear-gradient(to bottom right, #f8f9fb, #f5f6fa);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
  margin: 10px auto 10px auto; /* ⬆️ เพิ่มระยะห่างด้านบนจาก 60px → 120px */
  width: 100%;
  max-width: 1600px; /* ✅ กว้างสุด 1600px */
  transition: all 0.3s ease;
}

main.content.login-page:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
}

/* --- ส่วนหัวข้อความ --- */
main.content.login-page h2 {
  color: #1e2a4a;
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 10px;
}

main.content.login-page p {
  font-size: 15px;
  color: #555;
  margin-bottom: 25px;
}

/* --- ฟอร์มเข้าสู่ระบบ --- */
main.content.login-page form.search-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 360px;
}

main.content.login-page form.search-form input[type="text"],
main.content.login-page form.search-form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  transition: all 0.3s ease;
  font-family: 'Kanit', sans-serif;
}

main.content.login-page form.search-form input:focus {
  border-color: #b8860b;
  box-shadow: 0 0 6px rgba(184,134,11,0.3);
  outline: none;
  background-color: #fff;
}

/* --- ปุ่มเข้าสู่ระบบ --- */
main.content.login-page form.search-form button {
  background: linear-gradient(to right, #b8860b, #d4af37);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

main.content.login-page form.search-form button:hover {
  background: linear-gradient(to right, #a67c00, #d8b43c);
  transform: translateY(-1px);
}

/* --- ลิงก์สมัครใช้งาน --- */
main.content.login-page a {
  color: #1e3c72;
  text-decoration: none;
  font-weight: 400;
}

main.content.login-page a:hover {
  color: #b8860b;
  text-decoration: underline;
}

/* --- SweetAlert2 ให้เข้ากับธีมหลัก --- */
.swal2-popup {
  font-family: 'Kanit', sans-serif !important;
  border-radius: 12px !important;
}
.swal2-title {
  color: #1e2a4a !important;
}
.swal2-confirm {
  background: linear-gradient(to right, #b8860b, #d4af37) !important;
  border-radius: 8px !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  main.content.login-page {
    max-width: 95%;
    padding: 40px 25px;
    margin: 30px auto;
  }
  main.content.login-page h2 {
    font-size: 22px;
  }
}
/*  */
/* =============================
   HR PORTAL REGISTER PAGE (ELEGANT PREMIUM STYLE)
   ============================= */

main.content.register-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 100px 20px;
  min-height: 90vh;
  background: linear-gradient(135deg, #f8f9fb 0%, #f5f6fa 60%, #ffffff 100%);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  margin: 10px auto 10px auto;
  width: 100%;
  max-width: 1400px;
  transition: all 0.3s ease-in-out;
}

main.content.register-page:hover {
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.08);
}

/* --- Header Title --- */
main.content.register-page h2 {
  color: #1e3c72;
  font-size: 30px;
  font-weight: 500;
  margin-bottom: 8px;
}

main.content.register-page p {
  font-size: 16px;
  color: #666;
  margin-bottom: 40px;
}

/* --- Form Container --- */
main.content.register-page form.search-form {
  background: #ffffff;
  border-radius: 14px;
  padding: 40px 35px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  text-align: left;
}

/* --- Label --- */
main.content.register-page label {
  font-size: 15px;
  color: #333;
  margin-bottom: 4px;
  font-weight: 400;
}

/* --- Input Fields --- */
main.content.register-page input[type="text"],
main.content.register-page input[type="password"],
main.content.register-page input[type="email"],
main.content.register-page select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  background: #fafafa;
  transition: 0.3s ease;
  font-family: 'Kanit', sans-serif;
}

main.content.register-page input:focus,
main.content.register-page select:focus {
  border-color: #b8860b;
  box-shadow: 0 0 8px rgba(184, 134, 11, 0.3);
  background: #fff;
  outline: none;
}

/* --- Button --- */
main.content.register-page button {
  background: linear-gradient(to right, #b8860b, #d4af37);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 400;
}

main.content.register-page button:hover {
  background: linear-gradient(to right, #a67c00, #d8b43c);
  transform: translateY(-2px);
}

/* --- Link Section --- */
main.content.register-page .link-text {
  text-align: center;
  margin-top: 25px;
  font-size: 15px;
  color: #555;
}

main.content.register-page .link-text a {
  color: #1e3c72;
  text-decoration: none;
  font-weight: 500;
}

main.content.register-page .link-text a:hover {
  color: #b8860b;
  text-decoration: underline;
}

/* --- SweetAlert2 Style --- */
.swal2-popup {
  font-family: 'Kanit', sans-serif !important;
  border-radius: 12px !important;
}
.swal2-title {
  color: #1e3c72 !important;
}
.swal2-confirm {
  background: linear-gradient(to right, #b8860b, #d4af37) !important;
  border-radius: 8px !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  main.content.register-page {
    margin: 100px auto 60px;
    padding: 60px 15px;
    max-width: 95%;
  }
  main.content.register-page form.search-form {
    padding: 30px 20px;
  }
  main.content.register-page h2 {
    font-size: 24px;
  }
}
/*  */
.search-form {
  display: flex;
  justify-content: center; /* ✅ จากเดิม flex-start → ปรับให้อยู่กึ่งกลาง */
  align-items: center;
  gap: 12px;
  margin: 30px auto 25px auto; /* เพิ่มระยะขอบด้านบน */
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px; /* ✅ จำกัดความกว้างไม่ให้ยืดเต็มจอ */
}

.search-form input[type="text"],
.search-form select {
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  font-family: 'Kanit', sans-serif;
  transition: all 0.3s ease;
  min-width: 240px;
}

.search-form input[type="text"]:focus,
.search-form select:focus {
  border-color: #b8860b;
  box-shadow: 0 0 6px rgba(184,134,11,0.3);
  outline: none;
  background-color: #fff;
}
/* ======================================================
   🕒 Access Records (หน้าบันทึกเวลาเข้า–ออก)
   ====================================================== */

/* 🔹 ฟอร์มเพิ่มข้อมูล */
#addForm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  background: linear-gradient(to right, #faf8fc, #fdfdfd);
  padding: 25px 30px;
  border-radius: 14px;
  box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

#addForm label {
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
  display: block;
}

#addForm input[type="text"],
#addForm input[type="datetime-local"],
#addForm select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  transition: all 0.25s ease;
}

#addForm input:focus,
#addForm select:focus {
  border-color: #8e24aa;
  box-shadow: 0 0 6px rgba(142, 36, 170, 0.25);
  outline: none;
}

/* ปุ่มเพิ่มข้อมูล */
#addForm button {
  grid-column: 1 / -1;
  justify-self: center;
  background: linear-gradient(to right, #6a1b9a, #8e24aa);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.3s;
}

#addForm button:hover {
  background: linear-gradient(to right, #8e24aa, #ab47bc);
  transform: translateY(-1px);
}

/* 🔹 ส่วนกรอง */
.filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  background: #f9f9fb;
  border-radius: 14px;
  padding: 20px 25px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: 30px;
}

.filter div {
  flex: 1;
  min-width: 220px;
}

.filter label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: #444;
}

.filter select,
.filter input[type="date"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: 0.25s;
}

.filter button {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
}

.filter button:nth-child(1) {
  background: linear-gradient(to right, #6a1b9a, #8e24aa);
}
.filter button:nth-child(1):hover {
  background: linear-gradient(to right, #8e24aa, #ab47bc);
}
.filter button:nth-child(2) {
  background: #e57373;
}
.filter button:nth-child(2):hover {
  background: #ef5350;
}

.filter > div:last-child {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

/* 🔹 ตารางบันทึกเวลา */
#recordTable {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

#recordTable th {
  background: #f3e5f5;
  color: #4a148c;
  font-weight: 600;
  padding: 10px;
  text-align: center;
}

#recordTable td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

#recordTable tr:hover {
  background-color: #fafafa;
}
/* 🔹 ฟอร์มเพิ่มข้อมูล (Minimal Version) */
#addForm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 24px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 36px;
}

#addForm label {
  font-weight: 400;
  color: #555;
  font-size: 14px;
  margin-bottom: 6px;
  display: block;
}

#addForm input[type="text"],
#addForm input[type="datetime-local"],
#addForm select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d3d3d3;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: all 0.2s ease;
}

#addForm input:focus,
#addForm select:focus {
  border-color: #7b1fa2;
  background: #fdfcff;
  outline: none;
}

/* ปุ่มเพิ่มข้อมูล — เรียบ หรู */
#addForm button {
  grid-column: 1 / -1;
  justify-self: center;
  background: #7b1fa2;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: 0.25s ease;
}

#addForm button:hover {
  background: #6a1b9a;
}

/* 🔹 ส่วนกรอง */
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  background: #fcfcfc;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 22px 28px;
  margin-bottom: 28px;
}

.filter div {
  flex: 1;
  min-width: 220px;
}

.filter label {
  display: block;
  font-weight: 400;
  font-size: 14px;
  margin-bottom: 6px;
  color: #555;
}

.filter select,
.filter input[type="date"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: 0.2s ease;
}

.filter select:focus,
.filter input[type="date"]:focus {
  border-color: #7b1fa2;
  outline: none;
}

/* ปุ่มตัวกรอง */
.filter button {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s ease;
  font-weight: 400;
}

.filter button:first-child {
  background: #7b1fa2;
  color: white;
}
.filter button:first-child:hover {
  background: #6a1b9a;
}
.filter button:last-child {
  background: #ef5350;
  color: white;
}
.filter button:last-child:hover {
  background: #e53935;
}

.filter > div:last-child {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

/* 🔹 ตารางบันทึกเวลา (เรียบ หรู) */
#recordTable {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
}

#recordTable th {
  background: #f5f3f8;
  color: #4a148c;
  font-weight: 500;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}

#recordTable td {
  padding: 10px;
  text-align: center;
  border-top: 1px solid #eee;
  font-size: 14px;
  color: #444;
}

#recordTable tr:hover {
  background-color: #fafafa;
  transition: background 0.2s ease;
}

#recordTable input[type="checkbox"] {
  transform: scale(1.15);
  cursor: pointer;
}

/* 🔹 Responsive */
@media (max-width: 768px) {
  #addForm {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .filter {
    flex-direction: column;
    align-items: stretch;
  }
  .filter > div:last-child {
    justify-content: flex-start;
  }
}
/*  */
/* ===========================================================
   🗂️ Attendance Exception Approval Page (Minimal Elegant)
   Compatible with HR Service Portal Gold Theme
   =========================================================== */

/* 🔍 ส่วนกรองการค้นหา */
/* ==========================================================
   🎯 Filter Bar – Minimal Elegant Layout (Fixed Overlap Issue)
   ========================================================== */

.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* ✅ ปรับให้จัดชิดบน สวยกว่า align-items:end */
  justify-content: flex-start;
  gap: 22px 28px; /* ✅ เพิ่มระยะห่างทั้งแนวตั้งและแนวนอน */
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 24px 32px;
  margin: 25px auto 40px;
  max-width: 1100px; /* ✅ จำกัดความกว้างกลางหน้า ไม่ล้น */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.filter div {
  flex: 1 1 240px; /* ✅ ยืดได้ แต่มีขนาดขั้นต่ำ 240px */
  display: flex;
  flex-direction: column;
}

.filter label {
  font-size: 14px;
  font-weight: 400;
  color: #333;
  margin-bottom: 6px;
}

/* 🔹 Input & Select Field */
.filter input[type="text"],
.filter input[type="date"],
.filter select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: 0.25s ease;
  font-family: 'Kanit', sans-serif;
}

.filter input:focus,
.filter select:focus {
  border-color: #b8860b;
  box-shadow: 0 0 5px rgba(184, 134, 11, 0.25);
  outline: none;
  background-color: #fffef8;
}

/* 🔸 ปุ่มจัดวางแยกด้านขวา */
.filter .actions {
  flex: 0 1 auto;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: flex-end;
  margin-left: auto; /* ✅ ดันไปขวา */
}

/* ปุ่ม Filter & Reset */
.filter button {
  background: linear-gradient(to right, #b8860b, #9c7d2b);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  font-family: 'Kanit', sans-serif;
}

.filter button:hover {
  background: linear-gradient(to right, #9c7d2b, #b8860b);
  transform: translateY(-1px);
}

/* ปุ่ม Reset (แดงอ่อน) */
.filter button.reset {
  background: #e57373;
}
.filter button.reset:hover {
  background: #ef5350;
}

/* 🔹 Responsive – โทรศัพท์/แท็บเล็ต */
@media (max-width: 900px) {
  .filter {
    flex-direction: column;
    align-items: stretch;
    max-width: 95%;
    padding: 20px 22px;
  }
  .filter .actions {
    justify-content: flex-start;
    margin-left: 0;
  }
  .filter div {
    flex: 1 1 100%;
  }
}

/* 📋 ตารางข้อมูล */
.data-table {
  width: 95%;
  border-collapse: collapse;
  margin: 0 auto 50px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.data-table th {
  background: linear-gradient(to right, #faf7f2, #f3f0e8);
  color: #2c3e50;
  font-weight: 500;
  text-align: center;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

.data-table td {
  padding: 10px 12px;
  font-size: 14px;
  color: #444;
  text-align: center;
  border-bottom: 1px solid #f1f1f1;
}

.data-table tr:hover {
  background: #fffaf0;
  transition: 0.2s;
}

/* สถานะ */
.status {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  display: inline-block;
}

.status.pending {
  background: #fff3cd;
  color: #856404;
}
.status.approved {
  background: #d4edda;
  color: #155724;
}
.status.rejected {
  background: #f8d7da;
  color: #721c24;
}

/* ปุ่มอนุมัติ/ไม่อนุมัติ */
button.approve,
button.reject {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.25s ease;
}

button.approve {
  background: #28a745;
  color: white;
}
button.approve:hover {
  background: #218838;
}

button.reject {
  background: #dc3545;
  color: white;
}
button.reject:hover {
  background: #c82333;
}

/* ✅ ส่วนข้อความ "ไม่มีข้อมูล" */
.data-table td[colspan] {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 20px 0;
}

/* 📱 Responsive */
@media (max-width: 768px) {
  .filter {
    flex-direction: column;
    align-items: stretch;
  }
  .filter div {
    min-width: 100%;
  }
  .data-table th,
  .data-table td {
    font-size: 13px;
    padding: 8px;
  }
}
/*  */
/* ============================================================
   ⚜️ Attendance Exception List (HR Service Portal)
   ============================================================ */

/* 🔹 พื้นที่หลัก */
main.content.att-list {
  background: #fffefb;
  border-radius: 16px;
  padding: 40px 40px 60px;
  max-width: 1300px;
  margin: 40px auto;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.05);
  font-family: 'Kanit', sans-serif;
  transition: all 0.3s ease;
}

main.content.att-list:hover {
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
}

/* 🔹 ส่วนหัว */
main.content.att-list .welcome {
  text-align: center;
  margin-bottom: 30px;
}

main.content.att-list h2 {
  font-size: 28px;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 8px;
}

main.content.att-list h2 i {
  color: #b8860b;
  margin-right: 8px;
}

main.content.att-list p {
  font-size: 16px;
  color: #555;
  margin-bottom: 25px;
}

/* 🔹 ตารางหลัก */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.04);
}

.data-table th {
  background: linear-gradient(to right, #faf7f2, #f3f0e8);
  color: #2c3e50;
  font-weight: 500;
  padding: 12px 10px;
  text-align: center;
  font-size: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.data-table td {
  padding: 12px 10px;
  text-align: center;
  font-size: 15px;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.data-table tr:nth-child(even) {
  background: #fcfcfc;
}

.data-table tr:hover {
  background-color: #fff7e6;
  transition: 0.25s ease;
}

/* 🔹 ลิงก์ไฟล์แนบ */
.file-link {
  color: #b8860b;
  text-decoration: none;
  font-weight: 400;
  transition: 0.3s;
}

.file-link i {
  margin-right: 5px;
}

.file-link:hover {
  color: #8b7500;
  text-decoration: underline;
}

/* 🔹 สถานะ */
.status {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
  text-align: center;
  min-width: 100px;
}

/* รออนุมัติ */
.status.pending {
  background: #fff7e6;
  color: #b8860b;
  border: 1px solid #e5c07b;
}

/* อนุมัติแล้ว */
.status.approved {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

/* ไม่อนุมัติ */
.status.rejected {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* 🔹 Responsive */
@media (max-width: 992px) {
  main.content.att-list {
    padding: 25px 20px;
  }
  .data-table th,
  .data-table td {
    font-size: 14px;
    padding: 8px 6px;
  }
}

/* ============================================================
   📅 ฟอร์มกรองวันที่ Auto JS (Royal Minimal Style)
   ============================================================ */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 16px 20px;
  background: #fffefb;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 18px 25px;
  margin: 25px auto 40px;
  max-width: 900px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  font-family: 'Kanit', sans-serif;
}

.filter-form label {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 400;
  margin-bottom: 4px;
  display: block;
}

.filter-form input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: all 0.25s ease;
  font-family: 'Kanit', sans-serif;
  min-width: 180px;
}

.filter-form input:focus {
  border-color: #b8860b;
  box-shadow: 0 0 6px rgba(184,134,11,0.25);
  outline: none;
}

/* ปุ่มรีเซ็ต */
.filter-form .reset-btn {
  background: #e0e0e0;
  color: #333;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  text-decoration: none;
  transition: 0.3s;
}

.filter-form .reset-btn:hover {
  background: #b8860b;
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .filter-form {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }

  .filter-form input[type="date"],
  .filter-form .reset-btn {
    width: 100%;
  }
}

/*  */

