body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
}

header, nav, main, footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}
header {
    background-color: #005a8d;
    color: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding-bottom: 25px;
}
.app-header {
    background-color: #005a8d;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center; /* <-- จุดสำคัญ: ดันองค์ประกอบไปคนละฝั่ง */
    gap: 15px;
    border-radius: 0 0 15px 15px;
}
.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}


h1 { margin: 0; }
h3, h4 { color: #005a8d; }
nav {
    position: -webkit-sticky; /* สำหรับ Safari */
    position: sticky;
    top: 0;
    background-color: #f4f7f6; /* เพิ่มสีพื้นหลังเพื่อไม่ให้เนื้อหาข้างใต้ทะลุ */
    z-index: 900; /* ทำให้แสดงอยู่ชั้นบนสุดเสมอ */
    padding-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
nav h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.logo {
    max-width: 80px;
    margin-bottom: 20px;
}

/* --- Tab Menu Styles --- */
.tab-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-link {
    font-family: 'Sarabun', sans-serif;
    font-size: 18px;
    font-weight: bold;
    padding: 10px 30px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-link:hover {
    color: #005a8d;
}

.tab-link.active {
    color: #0077b6;
    border-bottom-color: #0077b6;
}

/* --- Tab Content Styles --- */
.tab-content {
    display: none; /* ซ่อนเนื้อหาทั้งหมดไว้ก่อน */
}

.tab-content.active {
    display: block; /* แสดงเฉพาะเนื้อหาของแท็บที่ถูกเลือก */
}

.sheet-container {
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: 80vh;
}

.sheet-container iframe {
    border: none;
    width: 100%;
    height: 100%;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: #5a6268;
}




table {
    font-size: 8px;
    /*width: 40%;*/
    /*table-layout: fixed;*/
    border-collapse: collapse;
    background: white;
}
th, td {
    border: 1px solid  #f9f9f9;
    border-bottom: 1px solid #f0f0f0;
    padding: 5px 2px;
    text-align: center;
}

th {
    background-color: #2196F3;
    color: white;
}
tr:nth-child(even) {
    background-color: white;
}



.history-good {
  background-color: #d4edda;
  color: #155724;
}

.history-warning-orange {
  background-color: #ffcc00;   /* สีพื้นหลัง */
  color: #000;                 /* สีตัวหนังสือ */
  padding: 1px 3px;
  /*padding: 3px 2px;            /* ระยะห่างรอบข้อความ */
  /*border-radius: 10px;          /* มุมโค้ง */
  /*font-weight: bold;           /* ตัวหนา */
  /*font-size: 10px;
  box-shadow: 0 0px 0px rgba(0,0,0,0.2); /* เงาให้เหมือนปุ่ม */
  /*border: 0px solid #e6b800;   /* เส้นขอบให้ใกล้เคียงสีพื้นหลัง */
  
}

.history-warning-red {
  background-color: #ff9100;
  color: #000000;
  padding: 1px 3px;
  /*
  padding: 3px 2px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 10px;
  box-shadow: 0 0px 0px rgba(0,0,0,0.2);
  border: 0px solid #ff9100;
  */
}

.history-warning-purple {
  background-color: #db0000;
  color: #ffffff;
  padding: 1px 3px;
  /*
  padding: 3px 2px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 10px;
  box-shadow: 0 0px 0px rgba(0,0,0,0.2);
  border: 0px solid #db0000;
  */
}

.history-warning-black {
  background-color: #000000;
  color: #ffffff;
  padding: 1px 3px;
  /*
  padding: 3px 2px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 10px;
  box-shadow: 0 0px 0px rgba(0,0,0,0.2);
  border: 0px solid #000000;
  */
}

.late-warning {
  background-color: #fff3cd;
  color: #856404;
}

.Absences-warning {
  background-color: #ffd9d9;
  color: #000000;
}

.status-late {
  background-color: orange;
  color: rgb(0, 0, 0);
  border-radius: 20px;
  font-size: 8px;
  
}

.status-absent {
  background-color: rgb(182, 0, 0);
  color: white;
  border-radius: 20px;
  font-size: 8px;

}

.status-leave {
  background-color: rgb(237, 250, 255);
  color: black;
  padding: 3px 2px;
  border-radius: 20px;
  font-size: 8px;
}



.note-box {
  margin-top: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-left: 6px solid #007bff;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  
}
.note-box strong {
  display: block;
  margin-bottom: 5px;
  color: #007bff;
  font-size: 16px;
}