.notification-indicator {
  position: relative;
  isolation: isolate;
  min-width: 0;
  height: 34px;
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: 48px 24px 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0;
  border: 0;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-blue-deep);
  cursor: pointer;
}

.notification-indicator:hover,
.notification-indicator:focus-visible {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.notification-indicator:focus-visible .notification-indicator__core {
  outline: 2px solid rgba(45, 134, 193, 0.35);
  outline-offset: 4px;
  border-radius: 50%;
}

.notification-indicator__light {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(58, 142, 196, 0.3) 14%, rgba(58, 142, 196, 0.72) 50%, rgba(58, 142, 196, 0.3) 86%, transparent 100%);
  box-shadow: 0 0 5px rgba(61, 151, 207, 0.18);
  transform-origin: center;
}

.notification-indicator__core {
  position: relative;
  width: 24px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--color-blue-deep);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 6px rgba(65, 160, 216, 0.22);
}

.notification-indicator__count {
  position: absolute;
  top: -6px;
  left: calc(50% + 7px);
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: radial-gradient(circle at 36% 28%, #ffffff 0%, #dcefff 38%, #4e95c5 100%);
  box-shadow: 0 3px 8px rgba(30, 74, 105, 0.28), inset 0 1px 2px rgba(255, 255, 255, 0.86);
  color: #113b5a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notification-indicator__count[hidden] {
  display: none;
}

.notification-indicator.has-active .notification-indicator__light {
  background: linear-gradient(90deg, transparent 0%, rgba(66, 166, 222, 0.38) 12%, rgba(93, 189, 239, 0.94) 50%, rgba(66, 166, 222, 0.38) 88%, transparent 100%);
  box-shadow: 0 0 7px rgba(65, 174, 234, 0.32);
}

.notification-indicator.has-active .notification-indicator__core {
  color: #217db7;
  text-shadow: 0 0 8px rgba(55, 157, 215, 0.38);
}

.notification-indicator.is-pulsing .notification-indicator__light {
  animation: accounting-notification-line-pulse 1.35s ease-in-out 10;
}

.notification-indicator.is-pulsing .notification-indicator__core {
  animation: accounting-notification-core-pulse 1.35s ease-in-out 10;
}

@keyframes accounting-notification-line-pulse {
  0%, 100% { opacity: 0.72; filter: brightness(1.06); box-shadow: 0 0 7px rgba(65, 174, 234, 0.3); }
  50% { opacity: 1; filter: brightness(1.5); box-shadow: 0 0 15px rgba(65, 174, 234, 0.72); }
}

@keyframes accounting-notification-core-pulse {
  0%, 100% { opacity: 0.82; filter: brightness(1.05); text-shadow: 0 0 7px rgba(55, 157, 215, 0.32); }
  50% { opacity: 1; filter: brightness(1.45); text-shadow: 0 0 15px rgba(55, 157, 215, 0.72); }
}

.notification-overlay {
  position: fixed;
  z-index: calc(var(--z-sidebar) + 2);
  top: 50%;
  left: 50%;
  width: min(calc(100vw - 2rem), 760px);
  max-height: min(78dvh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #a9c5d7;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #edf6fb);
  box-shadow: 0 24px 70px rgba(24, 62, 88, 0.32);
  transform: translate(-50%, -48%) scale(0.98);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.notification-overlay.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.notification-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--color-line);
}

.notification-overlay__header h2,
.notification-overlay__header p {
  margin: 0;
}

.notification-overlay__body {
  min-height: 0;
  overflow: auto;
  padding: 0 1.1rem 1rem;
}

.notification-overlay__summary {
  margin: 0;
  padding: 0.9rem 0;
  color: var(--color-text-soft);
}

.notification-group + .notification-group {
  margin-top: 1rem;
}

.notification-group__title {
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-blue-deep);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(96, 139, 168, 0.18);
}

.notification-row__meta,
.notification-row__title,
.notification-row__message {
  margin: 0;
}

.notification-row__meta {
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.notification-row__title {
  margin-top: 0.18rem;
  color: var(--color-text);
  font-size: 1rem;
}

.notification-row__message {
  margin-top: 0.3rem;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.notification-row--high,
.notification-row--critical {
  border-left: 3px solid var(--color-warning);
  padding-left: 0.7rem;
}

.notification-row--critical {
  border-left-color: var(--color-error);
}

.notification-row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

html[data-theme="dark"] .notification-overlay {
  border-color: var(--color-line);
  background: var(--color-shell);
  color: var(--color-text);
}

html[data-theme="dark"] .notification-indicator__core {
  color: #a8ddfb;
  text-shadow: 0 0 7px rgba(91, 190, 242, 0.46);
}

html[data-theme="dark"] .notification-indicator__light {
  background: linear-gradient(90deg, transparent 0%, rgba(85, 175, 228, 0.35) 14%, rgba(133, 210, 251, 0.86) 50%, rgba(85, 175, 228, 0.35) 86%, transparent 100%);
}

html[data-motion="reduced"] .notification-indicator.is-pulsing .notification-indicator__light,
html[data-motion="reduced"] .notification-indicator.is-pulsing .notification-indicator__core {
  animation: none;
}
