
/* ===== Popup Biểu đồ (Chart.js) – Fullscreen ===== */
.chart-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* ẩn mặc định */
  align-items: center;
  justify-content: center;
  z-index: 2001; /* cao hơn alert (2000) & ticker (1600) */
}
.chart-modal.show {
  display: flex;
}

.chart-modal__panel {
  width: 100%;
  height: min(84vh, 760px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-modal__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ad0c0c;
  color: #fff;
}
.chart-modal__topbar h2 {
  margin: 0;
  font-size: 16px;
}

.chart-modal__close {
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}
.chart-modal__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chart-modal__body {
  flex: 1 1 auto;
  padding: 12px;
}
.chart-modal__body canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-modal__footer {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #eee;
  background: #fafafa;
  font-size: 13px;
}
.chart-modal__hint {
  opacity: 0.75;
}




/* Đảm bảo panel nổi hẳn trên mọi overlay khác */
.chart-modal {
  z-index: 4000;
}

/* Cho phần thân đủ chỗ cho trục X của chart */
.chart-modal__body {
  flex: 1 1 auto;
  padding: 12px;
  overflow: hidden; /* tránh scrollbar thừa khi chart tự co giãn */
}

/* ===== End Popup Biểu đồ (Chart.js) – Fullscreen ===== */

/* ===== Modal: Tabs cho biểu đồ ===== */
.chart-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0 12px;
  border-bottom: 1px solid #e6e6e6;
}
.chart-tab-btn {
  border: 1px solid #bbb;
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 600;
  transform: translateY(1px);
}
.chart-tab-btn.active {
  background: #f7f7f7;
  border-bottom-color: #f7f7f7;
}
.chart-tab-panel {
  display: none;
}
.chart-tab-panel.show {
  display: block;
}
.chart-modal__body {
  position: relative;
  height: min(70vh, 540px);
}