.notification-center {
  position: relative;
  flex: 0 0 auto;
}

.notification-bell {
  position: relative;
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.notification-bell:hover,
.notification-bell[aria-expanded="true"] {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4f46e5;
}

.notification-bell:active {
  transform: scale(.96);
}

.notification-bell:focus-visible,
.notification-read-all:focus-visible,
.notification-panel__footer:focus-visible,
.notification-history__item:focus-visible,
.notification-history__read-all:focus-visible {
  outline: 3px solid rgba(99, 102, 241, .28);
  outline-offset: 2px;
}

.notification-bell svg {
  width: 1.35rem;
  height: 1.35rem;
}

.notification-badge {
  position: absolute;
  top: -.3rem;
  right: -.4rem;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 .28rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  line-height: 1rem;
  text-align: center;
}

.notification-panel[hidden],
.notification-badge[hidden],
.notification-read-all[hidden] {
  display: none !important;
}

.notification-history__read-all[hidden] {
  display: none !important;
}

.notification-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + .75rem);
  right: 0;
  width: min(24rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .16), 0 3px 12px rgba(15, 23, 42, .08);
}

.notification-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid #f1f5f9;
}

.notification-panel__header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 750;
}

.notification-panel__header p {
  margin: .15rem 0 0;
  color: #64748b;
  font-size: .75rem;
}

.notification-read-all,
.notification-history__read-all {
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: #4f46e5;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.notification-read-all:hover,
.notification-history__read-all:hover {
  background: #eef2ff;
}

.notification-read-all {
  padding: .35rem .45rem;
}

.notification-list {
  max-height: min(27rem, 66vh);
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) .45rem;
  gap: .7rem;
  align-items: start;
  padding: .85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: inherit;
  text-decoration: none;
  transition: background 140ms ease;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item.is-unread {
  background: #f5f7ff;
}

.notification-item.is-unread:hover {
  background: #eef2ff;
}

.notification-kind {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: .7rem;
  background: #f1f5f9;
  color: #475569;
  font-size: .72rem;
  font-weight: 800;
}

.notification-kind--assignment {
  background: #e0e7ff;
  color: #4338ca;
}

.notification-kind--welcome {
  background: #dcfce7;
  color: #15803d;
}

.notification-item__body,
.notification-history__body {
  min-width: 0;
}

.notification-item__title,
.notification-history__title {
  display: block;
  color: #0f172a;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.35;
}

.notification-item__message,
.notification-history__message {
  display: -webkit-box;
  margin-top: .18rem;
  overflow: hidden;
  color: #475569;
  font-size: .78rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item time,
.notification-history__item time {
  display: block;
  margin-top: .35rem;
  color: #94a3b8;
  font-size: .7rem;
}

.notification-unread-dot {
  width: .45rem;
  height: .45rem;
  margin-top: .35rem;
  border-radius: 999px;
  background: #6366f1;
}

.notification-state {
  padding: 2.5rem 1rem;
  color: #64748b;
  font-size: .84rem;
  text-align: center;
}

.notification-panel__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .8rem 1rem;
  background: #f8fafc;
  color: #4f46e5;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}

.notification-panel__footer:hover {
  background: #eef2ff;
}

.notification-history {
  max-width: 48rem;
  margin: 0 auto;
}

.notification-history__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.notification-history__eyebrow {
  margin: 0 0 .3rem !important;
  color: #6366f1 !important;
  font-size: .75rem !important;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-history__header h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.7rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -.025em;
}

.notification-history__header p:not(.notification-history__eyebrow) {
  margin: .4rem 0 0;
  color: #64748b;
  font-size: .92rem;
}

.notification-history__read-all {
  padding: .65rem .85rem;
  border: 1px solid #c7d2fe;
  background: #fff;
}

.notification-history__list {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.notification-history__item {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) .5rem;
  gap: .9rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #eef2f7;
  color: inherit;
  text-decoration: none;
  transition: background 140ms ease;
}

.notification-history__item:last-child {
  border-bottom: 0;
}

.notification-history__item:hover {
  background: #f8fafc;
}

.notification-history__item.is-unread {
  background: #f5f7ff;
}

.notification-history__item .notification-kind {
  width: 2.6rem;
  height: 2.6rem;
}

.notification-history__title {
  font-size: .95rem;
}

.notification-history__message {
  font-size: .84rem;
  -webkit-line-clamp: 3;
}

.notification-history__empty {
  padding: 4rem 1.5rem;
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #fff;
  text-align: center;
}

.notification-history__empty-icon {
  display: inline-flex;
  width: 3.5rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 1.4rem;
  font-weight: 800;
}

.notification-history__empty h2 {
  margin: 1rem 0 .35rem;
  color: #0f172a;
  font-size: 1.1rem;
}

.notification-history__empty p {
  margin: 0;
  color: #64748b;
  font-size: .88rem;
}

.notification-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  color: #64748b;
  font-size: .82rem;
}

.notification-pagination a {
  color: #4f46e5;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 640px) {
  .notification-panel {
    position: fixed;
    top: 4.25rem;
    right: 1rem;
    left: 1rem;
    width: auto;
  }

  .notification-history__header {
    align-items: flex-start;
    flex-direction: column;
    gap: .85rem;
  }

  .notification-history__read-all {
    align-self: stretch;
  }

  .notification-history__item {
    padding: .9rem;
  }
}
