/* Notification bell dropdown — works with Client (Tailwind header), Partner, Admin */

.notification-bell-wrap {
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

/* Client header: do not clip the dropdown (absolute fallback + fixed positioning from JS) */
#mainHeader .nav-actions--ltr-toolbar,
#mainHeader .notification-bell-wrap {
  overflow: visible;
}

.notification-bell-panel {
  /* JS sets position:fixed + top/left/width when open (desktop); this is no-JS / fallback */
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  width: min(22rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1rem);
  max-height: min(70vh, 28rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(226, 232, 240, 0.95);
  z-index: 100000;
  overflow: hidden;
  text-align: start;
  box-sizing: border-box;
}

.notification-bell-panel[hidden] {
  display: none !important;
}

.notification-bell-panel__header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  flex-shrink: 0;
}

.notification-bell-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.notification-bell-panel__body::-webkit-scrollbar {
  width: 8px;
}

.notification-bell-panel__body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.notification-bell-panel__body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.notification-bell-panel__body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.notification-bell-panel__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: flex-end;
  align-items: center;
  background: #fafafa;
  flex-shrink: 0;
}

.notification-bell-panel__footer a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b5b95;
  text-decoration: none;
}

.notification-bell-panel__footer a:hover {
  text-decoration: underline;
}

.notification-bell-row {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  cursor: pointer;
  text-align: inherit;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}

.notification-bell-row:hover,
.notification-bell-row:focus-visible {
  background: #f8fafc;
}

/* Read vs unread: muted slate for items the user has already seen (chat: API unreadCount; support: opened from bell) */
.notification-bell-row--read .notification-bell-row__title {
  font-weight: 500;
  color: #64748b;
}

.notification-bell-row--read .notification-bell-row__preview {
  color: #94a3b8;
}

.notification-bell-row--read .notification-bell-row__time {
  color: #94a3b8;
}

.notification-bell-row--read .notification-bell-row__badge--chat,
.notification-bell-row--read .notification-bell-row__badge--support {
  opacity: 0.88;
}

.notification-bell-row--unread .notification-bell-row__title {
  font-weight: 600;
  color: #0f172a;
}

.notification-bell-row--unread .notification-bell-row__preview {
  color: #64748b;
}

.notification-bell-row--unread .notification-bell-row__time {
  color: #64748b;
}

.notification-bell-row:last-child {
  border-bottom: none;
}

.notification-bell-row__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.notification-bell-row__badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.notification-bell-row__badge--chat {
  background: #ede9fe;
  color: #5b21b6;
}

.notification-bell-row__badge--support {
  background: #dbeafe;
  color: #1d4ed8;
}

.notification-bell-row__title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.notification-bell-row__time {
  font-size: 0.7rem;
  color: #64748b;
  flex-shrink: 0;
}

.notification-bell-row__preview {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.notification-bell-unread-dot {
  color: #dc2626;
  font-weight: 700;
}

.notification-bell-empty,
.notification-bell-loading,
.notification-bell-error {
  padding: 1.25rem 1rem;
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
}

.notification-bell-error {
  color: #b91c1c;
}

/* Badge on icon: logical end for RTL/LTR */
.notification-bell-wrap .notification-bell-badge {
  position: absolute;
  top: 0.125rem;
  inset-inline-end: 0.125rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.125rem;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.notification-bell-wrap .notification-bell-badge.is-visible {
  display: flex;
}

/* Mobile: geometry (top/left/right/max-height) comes from notification-bell.js — anchored under the bell. */
@media (max-width: 639px) {
  .notification-bell-panel.notification-bell-panel--mobile-sheet {
    position: fixed;
    z-index: 100050;
    width: auto;
    box-sizing: border-box;
    max-width: none;
    /* Do not set top/bottom/left/right here — avoids fighting JS and prevents bottom-pinned sheets on small screens */
  }
}

/* Partner header: toolbar is white (_PartnerLayout .DashboardHeader); icon must not use #fff (was for an old purple bar). */
.partner-notification-bell-wrap .notification-bell-panel {
  z-index: 100002;
}

.partner-bell-btn {
  position: relative;
  padding: 0.5rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--Primary-500, #6a5d8b);
}

/* Partner: inline SVG in markup (#6A5D8B strokes) — no webfont dependency. */
.partner-notification-bell-wrap .partner-bell-icon-wrap {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.partner-notification-bell-wrap .partner-bell-icon-wrap .partner-bell-svg {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.partner-notification-bell-wrap .notification-bell-badge {
  z-index: 2;
}

.partner-bell-btn:hover {
  background: rgba(106, 93, 139, 0.08);
}

.partner-bell-btn:focus-visible {
  outline: 2px solid rgba(106, 93, 139, 0.45);
  outline-offset: 2px;
}

.partner-bell-header-badge {
  position: absolute;
  top: 0.125rem;
  inset-inline-end: 0.125rem;
}

.clients .dashboard-header .admin-notification-bell-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.clients .dashboard-header .admin-bell-btn {
  position: relative;
  padding: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

.clients .dashboard-header .admin-bell-btn:focus-visible {
  outline: 2px solid #6b5b95;
  outline-offset: 2px;
}
