/* Shared in-app notification bell + panel (user, agency, map dashboard) */

.ra-notif {
  position: relative;
  flex-shrink: 0;
}

.ra-notif__bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ra-notif__bell:hover {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

.ra-notif__bell:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

.ra-notif__bell .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}

.agency-header .ra-notif__bell {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.35);
  color: #e2e8f0;
}

.agency-header .ra-notif__bell:hover {
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
}

.ra-notif__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  background: #e11d48;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.agency-header .ra-notif__badge {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}

.ra-notif__badge:empty,
.ra-notif__badge[data-count='0'] {
  display: none;
}

.ra-notif__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(380px, calc(100vw - 20px));
  max-height: min(72vh, 440px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #0f172a;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  z-index: 500;
  overflow: hidden;
}

.ra-notif__panel[hidden] {
  display: none !important;
}

.ra-notif__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ra-notif__panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ra-notif__mark-all {
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #16a34a;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
}

.ra-notif__mark-all:hover {
  background: rgba(22, 163, 74, 0.1);
}

.ra-notif__mark-all:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ra-notif__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  overflow-y: auto;
  flex: 1;
}

.ra-notif__item {
  margin: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.ra-notif__item:last-child {
  border-bottom: none;
}

.ra-notif__item-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.ra-notif__item-btn:hover {
  background: rgba(15, 23, 42, 0.04);
}

.ra-notif__item--unread .ra-notif__item-btn {
  background: rgba(34, 197, 94, 0.06);
}

.ra-notif__item-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  color: #0f172a;
}

.ra-notif__item-body {
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
  color: #475569;
}

.ra-notif__item-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.ra-notif__empty,
.ra-notif__error {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

.ra-notif__error {
  color: #b91c1c;
}

.ra-notif__loading {
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

.site-header .ra-notif__panel {
  z-index: 2000;
}

/* Theme: shared notification surfaces (user dashboard, map, agency header) */
html[data-theme="dark"] .ra-notif__bell {
  border-color: rgba(226, 232, 240, 0.14);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
}

html[data-theme="dark"] .ra-notif__bell:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(226, 232, 240, 0.22);
  color: #f8fafc;
}

html[data-theme="dark"] .ra-notif__badge {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.95);
}

html[data-theme="dark"] .ra-notif__panel {
  background: #1e293b;
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .ra-notif__panel-head {
  border-bottom-color: rgba(148, 163, 184, 0.15);
}

html[data-theme="dark"] .ra-notif__item {
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .ra-notif__item-btn:hover {
  background: rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .ra-notif__item--unread .ra-notif__item-btn {
  background: rgba(34, 197, 94, 0.12);
}

html[data-theme="dark"] .ra-notif__item-title {
  color: #f1f5f9;
}

html[data-theme="dark"] .ra-notif__item-body {
  color: #94a3b8;
}

html[data-theme="dark"] .ra-notif__item-meta {
  color: #64748b;
}

html[data-theme="dark"] .ra-notif__empty,
html[data-theme="dark"] .ra-notif__loading {
  color: #94a3b8;
}

html[data-theme="dark"] .ra-notif__error {
  color: #fca5a5;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .ra-notif__bell {
    border-color: rgba(226, 232, 240, 0.14);
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
  }

  html[data-theme="system"] .ra-notif__bell:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(226, 232, 240, 0.22);
    color: #f8fafc;
  }

  html[data-theme="system"] .ra-notif__badge {
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.95);
  }

  html[data-theme="system"] .ra-notif__panel {
    background: #1e293b;
    color: #f1f5f9;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  }

  html[data-theme="system"] .ra-notif__panel-head {
    border-bottom-color: rgba(148, 163, 184, 0.15);
  }

  html[data-theme="system"] .ra-notif__item {
    border-bottom-color: rgba(148, 163, 184, 0.12);
  }

  html[data-theme="system"] .ra-notif__item-btn:hover {
    background: rgba(148, 163, 184, 0.08);
  }

  html[data-theme="system"] .ra-notif__item--unread .ra-notif__item-btn {
    background: rgba(34, 197, 94, 0.12);
  }

  html[data-theme="system"] .ra-notif__item-title {
    color: #f1f5f9;
  }

  html[data-theme="system"] .ra-notif__item-body {
    color: #94a3b8;
  }

  html[data-theme="system"] .ra-notif__item-meta {
    color: #64748b;
  }

  html[data-theme="system"] .ra-notif__empty,
  html[data-theme="system"] .ra-notif__loading {
    color: #94a3b8;
  }

  html[data-theme="system"] .ra-notif__error {
    color: #fca5a5;
  }
}

html[data-theme="dark"] .agency-header .ra-notif__bell {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 35, 0.65);
  color: #e2e8f0;
}

html[data-theme="dark"] .agency-header .ra-notif__bell:hover {
  background: rgba(45, 55, 48, 0.85);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .agency-header .ra-notif__bell {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(30, 41, 35, 0.65);
    color: #e2e8f0;
  }

  html[data-theme="system"] .agency-header .ra-notif__bell:hover {
    background: rgba(45, 55, 48, 0.85);
    color: #fff;
  }
}
