/* thong_bao.css — nút chuông trên header + khung danh sách thông báo.
   Dùng biến màu của site.css (--brand, --line, --muted, --text). */

/* ---------- Nút chuông (kế thừa .icon-btn của site.css) ---------- */
.tb-btn { position: relative; font-size: 18px; }
.tb-btn--can { color: #b45309; border-color: #f59e0b; }

.tb-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.tb-badge[hidden] { display: none; }

/* ---------- Khung thông báo ---------- */
.tb-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line, #e2e6ee);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
  z-index: 9100;
  overflow: hidden;
}
.tb-panel[hidden] { display: none; }

.tb-head {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #e2e6ee);
  background: var(--brand, #0b3d91);
  color: #fff;
}
.tb-head__tieu-de { font-weight: 600; flex: 1; }
.tb-head__dong {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tb-list { overflow-y: auto; padding: 6px; }
.tb-rong { padding: 18px; text-align: center; color: var(--muted, #6b7280); font-size: 14px; }

.tb-muc {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13.5px;
  color: var(--text, #1f2937);
}
.tb-muc + .tb-muc { border-top: 1px solid #f1f3f7; }
.tb-muc--moi { background: #eef2ff; }
.tb-muc--can { background: #fff7e6; border-left: 3px solid #f59e0b; }

.tb-muc__tieu-de { font-weight: 600; margin-bottom: 4px; }
.tb-muc__noi-dung, .tb-muc__ai { white-space: pre-wrap; line-height: 1.45; }
.tb-muc__ai strong { color: var(--brand-dark, #082b66); }
.tb-muc__cu { margin-top: 4px; font-size: 12.5px; color: var(--muted, #6b7280); }

.tb-muc__chan {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.tb-muc__gio { font-size: 12px; color: var(--muted, #6b7280); flex: 1; }
.tb-muc__ket-qua { font-size: 12px; color: #047857; }
.tb-muc__loi { margin-top: 6px; font-size: 12.5px; color: #b91c1c; }

.tb-nut {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tb-nut:disabled { opacity: .5; cursor: default; }
.tb-nut--luu { background: #047857; color: #fff; }
.tb-nut--luu:hover:not(:disabled) { background: #065f46; }
.tb-nut--bo { background: #fff; color: #b91c1c; border-color: #fca5a5; }
.tb-nut--bo:hover:not(:disabled) { background: #fef2f2; }

/* ---------- Chân khung: thông báo đẩy (Web Push, 28/09/2026) ---------- */
.tb-push {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line, #e2e6ee);
  background: #f8fafc;
  font-size: 12.5px;
  color: var(--muted, #6b7280);
}
.tb-push:empty { display: none; }
.tb-push__chu { flex: 1; line-height: 1.4; }
.tb-push .tb-nut { white-space: nowrap; }
.tb-nut--phu { background: #fff; color: var(--muted, #6b7280); border-color: var(--line, #e2e6ee); }
.tb-nut--phu:hover:not(:disabled) { background: #f1f5f9; }

/* ---------- Hộp báo khi đang mở web (28/09/2026) ---------- */
.tb-toast-vung {
  position: fixed;
  top: 72px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9200;
  pointer-events: none;
}
.tb-toast {
  pointer-events: auto;
  cursor: pointer;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #f59e0b;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  font-size: 13.5px;
  color: var(--text, #1f2937);
  animation: tb-toast-vao .25s ease-out;
}
.tb-toast__tieu-de { font-weight: 600; }
.tb-toast__noi-dung { margin-top: 4px; color: var(--muted, #6b7280); white-space: pre-wrap; }
@keyframes tb-toast-vao {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Điện thoại (≤ 768px): HIỆN nút chuông (28/09/2026) ----------
   site.css ẩn cả `.topbar__right` trên điện thoại → nút chuông cũng mất.
   Chỉ hiện lại NÚT CHUÔNG ở góc phải header; trạng thái / đồng hồ / ⚙ vẫn ẩn
   như cũ. Menu giữa chừa 48px bên phải để không bị nút che. */
@media (max-width: 768px) {
  .topbar { position: relative; padding-right: 48px; }
  .topbar__right {
    display: flex;
    position: absolute;
    top: 0;
    right: 6px;
    bottom: 0;
    gap: 0;
  }
  .topbar__right > :not(.tb-btn) { display: none; }
  .tb-btn { width: 36px; height: 36px; font-size: 17px; }
  .tb-panel { top: 60px; left: 8px; right: 8px; width: auto; max-width: none; max-height: calc(100vh - 76px); }
  .tb-toast-vung { top: 62px; left: 8px; right: 8px; width: auto; max-width: none; }
}
