/* ============================================================
   AUTOSALES PRO — THÔNG BÁO TRONG APP (chuông 🔔) — pwa/js/thong-bao.js
   ============================================================ */

/* ---------- chuông + số đỏ ---------- */
.tbao-chuong{ position:relative; }
.tbao-so{
  position:absolute; top:3px; right:2px; min-width:18px; height:18px; padding:0 5px;
  border-radius:var(--bo-pill); background:var(--loi); color:#fff; border:2px solid var(--mat);
  font-size:10.5px; font-weight:800; line-height:14px; text-align:center; font-variant-numeric:tabular-nums;
}
.tbao-so[hidden]{ display:none; }
.tbao-lac svg{ animation:tbao-lac 3s ease-in-out 1s 2; transform-origin:50% 12%; }
@keyframes tbao-lac{ 0%,70%,100%{ transform:none; } 76%{ transform:rotate(14deg); } 82%{ transform:rotate(-12deg); } 88%{ transform:rotate(6deg); } }
@media (prefers-reduced-motion: reduce){ .tbao-lac svg{ animation:none; } }

/* máy tính: chuông ở header */
.tbao-chuong-dt{
  width:40px; height:40px; border-radius:10px; border:1px solid var(--ke-2); background:var(--mat);
  display:grid; place-items:center; cursor:pointer; color:var(--muc-2); flex:none;
}
.tbao-chuong-dt:hover{ background:var(--nhan-nhat); color:var(--nhan); border-color:var(--nhan-nhat); }
.tbao-chuong-dt svg{ width:20px; height:20px; }
.tbao-chuong-dt .tbao-so{ top:-6px; right:-6px; }

/* ---------- dải nhắc trên danh sách xe (điện thoại) ---------- */
.tbao-dai{
  margin:12px 16px 0; padding:10px 8px 10px 12px; border-radius:14px; cursor:pointer;
  background:var(--nhan-nhat); border:1px solid #D6E2FF; color:var(--nhan-dam);
  display:flex; align-items:flex-start; gap:10px; animation:tbao-vao .35s cubic-bezier(.32,.72,0,1);
}
@keyframes tbao-vao{ from{ opacity:0; transform:translateY(-6px); } }
.tbao-dai-ic{ flex:none; width:18px; height:18px; margin-top:1px; }
.tbao-dai-ic svg{ width:18px; height:18px; display:block; }
.tbao-dai-ic.qt{ color:var(--loi); }
.tbao-dai-chu{ flex:1; min-width:0; font-size:13px; line-height:1.45; }
.tbao-dai-chu b{ display:block; font-size:13.5px; font-weight:700; }
.tbao-dai-chu span{ display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; opacity:.85; }
.tbao-dai-x{ flex:none; width:28px; height:28px; margin:-4px 0 0; border:0; background:none; color:var(--muc-3); font-size:20px; line-height:1; cursor:pointer; border-radius:8px; }

/* ---------- danh sách ---------- */
.tbao-doc-het{ border:0; background:none; color:var(--nhan); font-weight:600; font-size:14px; padding:0 8px; height:40px; cursor:pointer; }
.tbao-doc-het[hidden]{ display:none; }
.tbao-loc{ display:flex; gap:8px; padding:12px 16px 4px; }
.tbao-loc button{
  height:32px; padding:0 14px; border-radius:var(--bo-pill); border:1px solid var(--ke-2);
  background:var(--mat); color:var(--muc-2); font-size:13px; font-weight:600; cursor:pointer;
}
.tbao-loc button.dang{ background:var(--muc); border-color:var(--muc); color:#fff; }
.tbao-nhom{ font-size:11.5px; font-weight:700; color:var(--muc-3); letter-spacing:.05em; text-transform:uppercase; padding:14px 16px 7px; }
.tbao-trong{ padding:48px 24px; text-align:center; color:var(--muc-3); font-size:14px; }
.tbao-dong{
  display:flex; gap:12px; width:100%; text-align:left; padding:13px 30px 13px 16px; position:relative;
  background:var(--mat); border:0; border-bottom:1px solid var(--ke); cursor:pointer; font:inherit; color:inherit;
}
.tbao-dong:active{ background:var(--nen); }
.tbao-dong.moi{ background:#F5F8FF; }
.tbao-dong.moi::after{ content:""; position:absolute; right:14px; top:19px; width:9px; height:9px; border-radius:50%; background:var(--nhan); }
.tbao-bieu{ width:42px; height:42px; border-radius:13px; flex:none; display:grid; place-items:center; background:var(--nhan-nhat); color:var(--nhan); }
.tbao-bieu svg{ width:21px; height:21px; }
.tbao-bieu.qt{ background:var(--loi-nhat); color:var(--loi); }
.tbao-bieu.to{ width:50px; height:50px; border-radius:15px; }
.tbao-bieu.to svg{ width:24px; height:24px; }
.tbao-chu{ flex:1; min-width:0; }
.tbao-chu b{ display:block; font-size:14.5px; line-height:1.35; font-weight:600; }
.tbao-dong.moi .tbao-chu b{ font-weight:800; }
.tbao-tom{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:13px; line-height:1.45; color:var(--muc-2); margin-top:2px; }
.tbao-chu small{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--muc-3); margin-top:5px; }
.tbao-qt{ display:inline-block; font-size:10px; font-weight:800; letter-spacing:.03em; color:var(--loi); background:var(--loi-nhat); border-radius:5px; padding:2px 6px; }

/* ---------- chi tiết ---------- */
.tbao-than-ct{ background:var(--mat); }
.tbao-ct{ padding:20px 18px 28px; }
.tbao-ct .tbao-bieu{ margin-bottom:14px; }
.tbao-ct .tbao-qt{ margin-bottom:8px; }
.tbao-ct h3{ font-size:20px; line-height:1.3; letter-spacing:-.01em; font-weight:800; }
.tbao-gio{ font-size:12.5px; color:var(--muc-3); margin:6px 0 16px; }
.tbao-nd{ font-size:15px; line-height:1.65; color:#2A303A; white-space:pre-line; word-break:break-word; }
.tbao-nd a{ color:var(--nhan); font-weight:600; word-break:break-all; }
.tbao-nut{ width:100%; margin-top:22px; }
.tbao-nut-phu{ width:100%; margin-top:8px; height:46px; }

/* ---------- hộp nổi "Quan trọng" ---------- */
.tbao-hop-nen{
  position:fixed; inset:0; z-index:9000; background:rgba(11,13,18,.45);
  display:flex; align-items:center; justify-content:center; padding:22px;
  opacity:0; transition:opacity .22s;
}
.tbao-hop-nen.mo{ opacity:1; }
.tbao-hop{
  width:100%; max-width:380px; max-height:calc(100vh - 44px); overflow:auto;
  background:var(--mat); border-radius:22px; padding:22px 20px 18px; text-align:center;
  box-shadow:0 20px 50px -10px rgba(0,0,0,.35);
  transform:translateY(20px) scale(.96); transition:transform .32s cubic-bezier(.32,.72,0,1);
}
.tbao-hop-nen.mo .tbao-hop{ transform:none; }
.tbao-hop .tbao-bieu{ margin:0 auto 12px; }
.tbao-hop .tbao-qt{ margin-bottom:8px; }
.tbao-hop h3{ font-size:18px; line-height:1.35; font-weight:800; }
.tbao-hop .tbao-nd{ font-size:14px; color:var(--muc-2); margin-top:8px; line-height:1.6; }
.tbao-hop .tbao-nut{ margin-top:18px; }

/* ---------- máy tính: bảng trượt bên phải ---------- */
.tbao-panel-nen{ position:fixed; inset:0; z-index:8000; background:rgba(11,23,54,.22); opacity:0; pointer-events:none; transition:opacity .2s; }
.tbao-panel-nen.mo{ opacity:1; pointer-events:auto; }
.tbao-panel{
  position:fixed; top:0; right:0; bottom:0; width:400px; max-width:100vw; z-index:8001;
  background:var(--nen); display:flex; flex-direction:column;
  box-shadow:-20px 0 50px -30px rgba(11,23,54,.45);
  transform:translateX(100%); transition:transform .26s cubic-bezier(.32,.72,0,1);
}
.tbao-panel.mo{ transform:none; }
.tbao-panel-dau{
  display:flex; align-items:center; gap:6px; padding:14px 12px 14px 18px; background:var(--mat);
  border-bottom:1px solid var(--ke); flex:none;
}
.tbao-panel-dau b{ flex:1; font-size:17px; font-weight:800; }
.tbao-ic{ width:36px; height:36px; border-radius:9px; border:0; background:none; cursor:pointer; color:var(--muc-2); font-size:24px; line-height:1; display:grid; place-items:center; }
.tbao-ic:hover{ background:var(--nen); }
.tbao-ic svg{ stroke:currentColor; width:20px; height:20px; }
.tbao-panel-than{ flex:1; overflow:auto; }
.tbao-panel .tbao-dong:hover{ background:#FAFBFC; }
.tbao-panel .tbao-dong.moi:hover{ background:#EEF3FF; }
.tbao-panel .tbao-ct{ background:var(--mat); min-height:100%; }
.tbao-panel .tbao-nut{ height:46px; }
