/* ==================== CÀI ĐẶT CHUNG ==================== */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-image: url('background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
}

/*===================== ĐĂNG NHẬP =======================*/
.login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.login-box {
  background: #fff;
  padding: 30px 40px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  width: 300px;
}

.login-box h2 {
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.login-box button {
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-weight: bold;
}

/* ==================== DASHBOARD ==================== */
.dashboard {
  text-align: center;
  width: 90%;
  max-width: 700px;
  margin: 40px auto; /* căn giữa và tạo khoảng cách trên/dưới */
  background: rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Tiêu đề chính */
h1 {
  font-size: 30px;
  color: #fff;
  margin-bottom: 20px;
}

/* ==================== THẺ THÔNG SỐ ==================== */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  justify-content: center;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  transition: all 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card h2 {
  margin: 0;
  font-size: 22px;
  color: #333;
}

.value {
  font-size: 26px;
  font-weight: bold;
  color: #222;
  margin-top: 10px;
}

/* Ảnh trong thẻ (background) */
.card img {
  width: 100%;
  border-radius: 10px;
  margin-top: 10px;
  border: 4px solid #ccc;
}

/* Trạng thái sức khỏe */
.health-status {
  position: fixed;
  left: 10px;
  bottom: -110px;
  background: rgba(255,255,255,0.95);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #0a7e07;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  transition: background 0.3s, color 0.3s;
}
.health-status.danger {
  color: #c62828;
}
.health-status.warning {
  color: #e69500;
}

/* ==================== BIỂU ĐỒ ==================== */
canvas {
  width: 100%;
  height: 500px;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
}

/* ==================== SIDEBAR ==================== */
#toggleSidebar {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 24px;
  background: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 1001;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 250px;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
  padding: 80px 20px 30px;
  transition: left 0.3s ease;
  z-index: 1000;
}

.sidebar.active {
  left: 0;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 24px;
  color: #333;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  margin: 20px 0;
}

.sidebar a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

/* ==================== GIAO DIỆN CÁC VIEW ==================== */
.view-section {
  margin-top: 30px;
}

/* ==================== PHIÊN BẢN CHO ĐIỆN THOẠI ==================== */
@media (max-width: 600px) {
  .container {
      grid-template-columns: 1fr;
  }
}
