/*
 * Notification centre (21 Aban 1405): header bell with unread badge, dropdown list, /account/notifications page,
 * push device panel and per-group preference table. Uses the shared colour tokens of site.css, so dark mode follows them.
 */

/* ---------- bell ---------- */
.notif-bell__btn {
  position: relative; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.05rem;
}
.notif-bell__btn:hover, .notif-bell__btn:focus-visible { color: var(--brand-blue); border-color: var(--brand-blue); }
.notif-bell__badge {
  position: absolute; top: -.3rem; inset-inline-end: -.3rem; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
  border-radius: 999px; background: #E5484D; color: #fff; font-size: .7rem; font-weight: 800; line-height: 1.25rem; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.notif-bell__badge[hidden] { display: none; }
.site-header__bell { order: 2; margin-inline-start: auto; }
@media (min-width: 992px) { .site-header__bell { margin-inline-start: .5rem; } }

.notif-menu { width: min(22rem, calc(100vw - 2rem)); padding: 0; overflow: hidden; border-radius: var(--radius-sm); border-color: var(--border); background: var(--surface); }
.notif-menu__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
.notif-menu__list { max-height: min(24rem, 60vh); overflow-y: auto; }
.notif-menu__item { display: flex; gap: .65rem; padding: .7rem .9rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.notif-menu__item:last-child { border-bottom: 0; }
.notif-menu__item:hover, .notif-menu__item:focus-visible { background: var(--surface-muted); }
.notif-menu__item i { flex: 0 0 auto; margin-top: .2rem; color: var(--brand-blue); }
.notif-menu__item span { display: flex; flex-direction: column; min-width: 0; }
.notif-menu__item strong { font-size: .9rem; overflow-wrap: anywhere; }
.notif-menu__item small { color: var(--text-muted); font-size: .78rem; line-height: 1.7; overflow-wrap: anywhere; }
.notif-menu__item.is-unread strong::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-inline-end: .35rem; border-radius: 50%; background: var(--brand-blue); vertical-align: middle; }

.empty-state--compact { padding: 1rem; }
.empty-state--compact > i { width: 2.6rem; height: 2.6rem; font-size: 1.05rem; }

/* ---------- page ---------- */
.notif-layout { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 992px) { .notif-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.notif-layout .panel, .notif-side .panel { margin: 0; }
.notif-side { display: grid; gap: 1rem; }
.notif-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.notif-filter { display: flex; gap: .35rem; }
.notif-filter .btn, .notif-toolbar .btn { white-space: nowrap; }

.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.notif-item { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.notif-item.is-unread { border-inline-start: 4px solid var(--brand-blue); background: var(--surface-muted); }
.notif-item__icon { flex: 0 0 auto; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: rgba(26, 111, 209, .12); color: var(--brand-blue); }
.notif-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; color: var(--text); text-decoration: none; }
.notif-item__body:hover strong { color: var(--brand-blue); }
.notif-item__body strong { overflow-wrap: anywhere; }
.notif-item__body span { color: var(--text-muted); font-size: .9rem; line-height: 1.8; overflow-wrap: anywhere; }
.notif-item__body small { color: var(--text-muted); font-size: .78rem; }
.notif-item__action { flex: 0 0 auto; }

.push-panel__state { margin-bottom: .6rem; font-weight: 600; }
.push-panel__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.push-panel__actions .btn { white-space: nowrap; }

.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.device-list__item { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.device-list__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.device-list__text small { color: var(--text-muted); font-size: .78rem; overflow-wrap: anywhere; }

.pref-table { margin-bottom: .5rem; --bs-table-bg: transparent; color: var(--text); }
.pref-table th, .pref-table td { border-color: var(--border); }
.pref-table th[scope="row"] { font-weight: 600; white-space: nowrap; }
.pref-table .form-check-input { width: 1.25rem; height: 1.25rem; float: none; margin: 0; }

/* ---------- admin ---------- */
.notif-channels { display: flex; flex-wrap: wrap; gap: .35rem; }
.notif-log__body { color: var(--text-muted); font-size: .85rem; overflow-wrap: anywhere; }
.notif-warning { border-inline-start: 4px solid #c77700; }
