/* ===== Reset cơ bản ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  padding: 20px;
  margin: 0;
  background-color: #f4f6f9;
}

/* ===== Tiêu đề ===== */
h1 {
  text-align: center;
  color: #333;
  margin-bottom: 25px;
}

/* ===== Khu vực tìm kiếm ===== */
.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-box label {
  font-weight: bold;
}

.search-box input[type="date"] {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.search-box button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.search-box button:hover {
  background-color: #43a047;
}

/* ===== Tổng số bệnh nhân ===== */
#totalCount {
  text-align: center;
  margin-top: 10px;
  font-size: 18px;
  color: #222;
}

#totalCount b {
  color: #e53935;
  font-size: 20px;
}

/* ===== Bảng ===== */
.results {
  width: 100%;
  overflow-x: auto; /* Cho phép scroll ngang khi cần */
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: white;
  min-width: 700px; /* Giữ bảng không bị ép quá nhỏ */
}

th, td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
  font-size: 14px;
}

th {
  background-color: #f2f2f2;
  font-weight: bold;
}

tr:hover {
  background-color: #f9f9f9;
}

/* ===== Nút quay lại ===== */
.btn-back-container {
  margin-top: 25px;
  text-align: left;
}

.btn-back {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  background-color: #4CAF50;
  text-decoration: none;
  color: white;
  transition: 0.2s;
}

.btn-back:hover {
  background-color: #388e3c;
}

/* ============================= */
/* ===== Responsive Mobile ===== */
/* ============================= */

@media (max-width: 768px) {

  body {
    padding: 15px;
  }

  h1 {
    font-size: 20px;
  }

  .search-box {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input,
  .search-box button {
    width: 100%;
  }

  #totalCount {
    font-size: 16px;
  }

  th, td {
    font-size: 13px;
    padding: 8px;
  }

}
