.notif-btn-wrap {
  position: relative;
  display: inline-flex;
  margin-left: 0.25rem;
}

.notif-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  position: relative;
  line-height: 1;
}

.notif-btn:hover {
  border-color: var(--blue-light);
  color: var(--text);
  background: rgba(31, 111, 235, 0.08);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.notif-panel {
  position: fixed;
  top: 52px;
  right: 12px;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 99999;
  display: none;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}

.notif-panel.open {
  display: flex;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notif-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.notif-read-all {
  background: none;
  border: none;
  color: var(--blue-light);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: inherit;
  transition: background 0.12s;
}

.notif-read-all:hover {
  background: rgba(31, 111, 235, 0.1);
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  cursor: default;
}

.notif-item:hover {
  background: var(--bg3);
}

.notif-item.is-unread {
  background: rgba(31, 111, 235, 0.04);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
}

.notif-dot.is-unread {
  background: var(--blue-light);
}

.notif-dot.is-read {
  background: transparent;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-msg {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.notif-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.notif-dismiss {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
  margin-top: 2px;
  padding: 0;
  line-height: 1;
}

.notif-dismiss:hover {
  color: var(--red-light);
  background: rgba(218, 54, 51, 0.1);
}

.notif-empty {
  padding: 1.5rem 0.85rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (max-width: 500px) {
  .notif-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 14px 14px 0 0;
    border-bottom: none;
  }
}
