/* Chuông thông báo, thanh Bộ lọc đã lưu / Yêu thích, toast, trang /notifications */
.hd-link { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--text); background: none; border: 0; cursor: pointer; font-family: inherit; }
.hd-link:hover { background: var(--bg); color: var(--accent-ink); }
.hd-pop { position: relative; }
.nt-bell { position: relative; font-size: 18px; padding: 5px 8px; line-height: 1; }
.nt-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }
.nt-badge[hidden] { display: none; }
.nt-bell.ring { animation: nt-ring .8s ease; }
@keyframes nt-ring { 0%,100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } }

.nt-panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16); z-index: 1100; overflow: hidden; }
.nt-panel.open { display: block; }
.nt-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nt-head b { font-size: 15px; }
.nt-linkbtn { background: none; border: 0; color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.nt-linkbtn:hover { text-decoration: underline; }
.nt-list { max-height: 420px; overflow-y: auto; }
.nt-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f1f2f4; cursor: pointer; position: relative; text-align: left; width: 100%; background: #fff; border-left: 0; border-right: 0; border-top: 0; font: inherit; color: var(--text); }
.nt-item:hover { background: #fafafa; }
.nt-item.unread { background: var(--primary-soft); }
.nt-item.unread:hover { background: #fdf0c8; }
.nt-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; background: #f3f4f6; }
.nt-ico.ok { background: #dcfce7; } .nt-ico.bad { background: #fee2e2; } .nt-ico.warn { background: #fef3c7; } .nt-ico.info { background: #dbeafe; } .nt-ico.hot { background: #fdf0c8; }
.nt-txt { flex: 1; min-width: 0; }
.nt-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.nt-body { color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nt-time { color: var(--muted); font-size: 12px; margin-top: 3px; }
.nt-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; }
.nt-empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.nt-foot { padding: 10px; text-align: center; border-top: 1px solid var(--line); background: #fafafa; }
.nt-foot a { color: var(--accent-ink); font-weight: 600; font-size: 14px; }

.sf-panel { width: 320px; }
.sf-row { display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 14px; border-bottom: 1px solid #f1f2f4; }
.sf-row:hover { background: #fafafa; }
.sf-apply { flex: 1; text-align: left; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); padding: 2px 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-apply small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.sf-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.sf-del:hover { background: #fee2e2; color: var(--err); }

/* toast thông báo mới */
#nt-toasts { position: fixed; top: 70px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 32px); pointer-events: none; }
.nt-toast { pointer-events: auto; display: flex; gap: 10px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 11px 12px; cursor: pointer; animation: nt-in .25s ease; }
.nt-toast.out { opacity: 0; transform: translateX(20px); transition: all .25s; }
.nt-toast-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; align-self: flex-start; padding: 0 2px; }
@keyframes nt-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* trang /notifications */
.ntp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ntp-head h1 { margin: 0; }
.ntp-card { padding: 0 !important; overflow: hidden; }
.ntp-card .nt-item { padding: 14px 16px; cursor: pointer; }
.ntp-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 6px; align-self: flex-start; }
.ntp-del:hover { background: #fee2e2; color: var(--err); }
.ntp-row { display: flex; align-items: stretch; border-bottom: 1px solid #f1f2f4; background: #fff; }
.ntp-row.unread { background: var(--primary-soft); }
.ntp-row .nt-item { border-bottom: 0; background: transparent; flex: 1; min-width: 0; }
.ntp-row .nt-body { -webkit-line-clamp: 4; }
.ntp-row .ntp-del { margin: 12px 10px 0 0; }
.nt-ann { display: inline-block; font-size: 11px; font-weight: 700; color: #1d4ed8; background: #dbeafe; border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }

/* admin: thông báo hệ thống */
.ann-form textarea { min-height: 80px; }
.ann-form .row > .field { margin-bottom: 0; }

@media (max-width: 760px) {
  .hd-label { display: none; }
  .bar { gap: 10px; }
  .bar-right { gap: 2px; }
  .hd-link { padding: 6px 5px; }
  /* trên điện thoại panel cố định theo khung nhìn để không tràn */
  /* top được notifications.js đặt động theo getBoundingClientRect của nút (62px chỉ là dự phòng) */
  .nt-panel, .sf-panel { position: fixed; left: 8px; right: 8px; top: 62px; width: auto; max-width: none; }
  .nt-list { max-height: 60vh; }
  #nt-toasts { top: 64px; right: 8px; left: 8px; width: auto; max-width: none; }
}
