html,
body {
  max-width: 100%;

}

body {
  font-family: 'Kanit', sans-serif;
  background-color: #f4f7fc;
  padding: 5px;
}


.header-bar {
  background-color: #C5D3E8;
  color: white;
  padding: 15px 0;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-bar a {
  text-decoration: none;

  font-weight: 600;
  margin: 0 15px;
}

.header-bar a:hover {
  text-decoration: none;
}

.table-scroll-container {
  overflow: auto;
  max-height: 60vh;
  max-width: 100%;
}

.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;

  /*table-layout: fixed; /* กำหนดให้ตารางไม่ล้นขอบ */
  /*word-wrap: break-word; /* ห่อข้อความไม่ให้ล้น */
}

.modern-table thead {
  background-color: #687FE5;
  color: white;
}

.modern-table thead th {
  padding: 12px;
  text-align: center;
  font-weight: normal;
  border: 1px solid #fff;
  font-size: 13px;
  white-space: nowrap;
  /* หลีกเลี่ยงการตัดหัวข้อ */
}

.modern-table tbody tr {
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.modern-table tbody tr:hover {
  transform: scale(1.01);
  background-color: #f0f4ff;
}

.modern-table td {
  padding: 12px;
  text-align: center;
  border: 1px solid #fff;
  overflow-wrap: break-word;
  white-space: normal;
  font-size: 12px;
}

.modern-table img {
  max-width: 100%;
  max-height: 60px;
  border-radius: 6px;
  height: auto;
}

input.form-control.form-control-sm {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.btn-info {
  background-color: #00bcd4;
  border: none;
  color: white;

  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  /* Animation */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);


}

.btn-info:hover {
  background-color: #0097a7;
  color: white;
  /* Animation */
  transform: scale(1.03);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}



.btn-success {
  background-color: #4CAF50;
  /* สีเขียว */
  border: none;
  color: white;

  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  /* Animation */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);


}

.btn-success:hover {
  background-color: #45a049;
  /* สีเขียวเข้ม */
  color: white;
  /* Animation */
  transform: scale(1.03);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}



.btn-danger {
  background-color: #FF4B4B;
  border: none;
  color: white;

  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  /* Animation */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-danger:hover {
  background-color: #FF3333;
  /* Animation */
  transform: scale(1.03);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  /* ป้องกันปุ่มล้น */
}

.table-container {
  margin-top: 30px;
}

/* Mobile Card Style */
.mobile-card {
  display: none;
}

@media (max-width: 768px) {
  .modern-table {
    display: none;
  }

  .mobile-card {
    display: block;
  }

  .mobile-card .card {
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .mobile-card .card img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
  }

  .card-body .form-control-sm {
    width: 100%;
    margin-bottom: 8px;
    max-width: 100%;
  }

  .count-tag {
    display: inline-block;
    font-weight: bold;
    padding: 3px 8px;
    background: #e0e0e0;
    border-radius: 4px;
  }

  .btn-container {
    flex-direction: column;
    gap: 10px;
  }
}

/* Responsive font size */
@media (max-width: 992px) {

  .modern-table th,
  .modern-table td,
  .modern-table input,
  .modern-table span {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {

  .modern-table th,
  .modern-table td,
  .modern-table input,
  .modern-table span {
    font-size: 0.8rem;
  }
}